From 0e86f4a66ded46a44c82cda74e48db42a8a5b8b2 Mon Sep 17 00:00:00 2001 From: Roardom Date: Sun, 9 Apr 2023 00:10:13 +0000 Subject: [PATCH] fix: unnecessary isset --- .../Controllers/TorrentBuffController.php | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/TorrentBuffController.php b/app/Http/Controllers/TorrentBuffController.php index c0b3445b1..c224847bd 100644 --- a/app/Http/Controllers/TorrentBuffController.php +++ b/app/Http/Controllers/TorrentBuffController.php @@ -184,21 +184,18 @@ class TorrentBuffController extends Controller $featured_torrent = FeaturedTorrent::where('torrent_id', '=', $id)->firstOrFail(); $torrent = Torrent::withAnyStatus()->findOrFail($id); + $torrent->free = '0'; + $torrent->doubleup = '0'; + $torrent->featured = '0'; + $torrent->save(); - if (isset($torrent)) { - $torrent->free = '0'; - $torrent->doubleup = '0'; - $torrent->featured = '0'; - $torrent->save(); + Unit3dAnnounce::addTorrent($torrent); - Unit3dAnnounce::addTorrent($torrent); + $appurl = config('app.url'); - $appurl = config('app.url'); - - $this->chatRepository->systemMessage( - sprintf('Ladies and Gents, [url=%s/torrents/%s]%s[/url] is no longer featured. :poop:', $appurl, $torrent->id, $torrent->name) - ); - } + $this->chatRepository->systemMessage( + sprintf('Ladies and Gents, [url=%s/torrents/%s]%s[/url] is no longer featured. :poop:', $appurl, $torrent->id, $torrent->name) + ); $featured_torrent->delete();