File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,10 @@ final public function handle(): void
57
57
58
58
User::query ()
59
59
->withSum ('seedingTorrents as seedsize ' , 'size ' )
60
- ->withCount ('torrents as uploads ' )
60
+ ->withCount ([
61
+ 'torrents as uploads ' ,
62
+ 'warnings ' => fn ($ query ) => $ query ->where ('active ' , '= ' , true ),
63
+ ])
61
64
->withAvg ('history as avg_seedtime ' , 'seedtime ' )
62
65
->whereIntegerInRaw ('group_id ' , $ groups ->pluck ('id ' ))
63
66
->chunkById (100 , function ($ users ) use ($ groups , $ timestamp ): void {
@@ -78,7 +81,7 @@ final public function handle(): void
78
81
// Keep these as 0/1 instead of false/true
79
82
// because it reduces 6% custom casting overhead
80
83
$ user ->can_download = 0 ;
81
- } else {
84
+ } elseif ( $ user -> warnings_count < config ( ' hitrun.max_warnings ' )) {
82
85
$ user ->can_download = 1 ;
83
86
}
84
87
You can’t perform that action at this time.
0 commit comments