From 86d5dbb2fde47996ee2dc0fa2ff5c4703557fc93 Mon Sep 17 00:00:00 2001 From: HDVinnie Date: Tue, 10 Oct 2023 17:39:11 -0400 Subject: [PATCH] fix: #3144 - cache returns -1 as a string --- app/Http/Controllers/AnnounceController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/AnnounceController.php b/app/Http/Controllers/AnnounceController.php index bb27b0cae..a3830ea43 100644 --- a/app/Http/Controllers/AnnounceController.php +++ b/app/Http/Controllers/AnnounceController.php @@ -384,11 +384,11 @@ class AnnounceController extends Controller fn () => Torrent::withoutGlobalScope(ApprovedScope::class) ->select(['id', 'free', 'doubleup', 'seeders', 'leechers', 'times_completed', 'status']) ->where('info_hash', '=', $infoHash) - ->first() + ->firstOr(fn () => -1) ); // If Torrent Doesn't Exsist Return Error to Client - if ($torrent === null) { + if ($torrent === '-1') { throw new TrackerException(150); }