mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-20 08:42:03 -05:00
fix: announce controller
Check if client is announcing torrent as complete before applying slots error
This commit is contained in:
@@ -112,7 +112,7 @@ class AnnounceController extends Controller
|
||||
* Check Download Slots.
|
||||
*/
|
||||
if (\config('announce.slots_system.enabled') == true) {
|
||||
$this->checkDownloadSlots($user);
|
||||
$this->checkDownloadSlots($queries, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -402,15 +402,15 @@ class AnnounceController extends Controller
|
||||
/**
|
||||
* @throws \App\Exceptions\TrackerException
|
||||
*/
|
||||
private function checkDownloadSlots($user): void
|
||||
private function checkDownloadSlots($queries, $user): void
|
||||
{
|
||||
$max = $user->group->download_slots;
|
||||
|
||||
if ($max !== null && $max >= 0) {
|
||||
if ($max !== null && $max >= 0 && $queries['left'] != 0) {
|
||||
$count = Peer::where('user_id', '=', $user->id)
|
||||
->where('seeder', '=', 0)
|
||||
->count();
|
||||
if ($count >= $max) {
|
||||
if ($count >= $max ) {
|
||||
throw new TrackerException(164, [':max' => $max]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user