From c487c42c8c69b826357a1fe9b66ced686175d05d Mon Sep 17 00:00:00 2001 From: "Stiliyan Tonev (Bark)" Date: Tue, 20 May 2025 16:29:49 +0300 Subject: [PATCH] fix: I misunderstood the comment. Logic should be improved now. --- src/webui/api/torrentscontroller.cpp | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index 5dce199f7..fb89d0922 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -1138,20 +1138,6 @@ void TorrentsController::addTrackersAction() // add this tracker to all torrents torrents = BitTorrent::Session::instance()->torrents(); } - else if (hashParam.contains(u'|')) - { - // We have this, so that we won't enter the `else` and break it. - } - else - { - // add this tracker just to this torrent - const auto id = BitTorrent::TorrentID::fromString(hashParam); - BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->getTorrent(id); - if (!torrent) - throw APIError(APIErrorType::NotFound); - - torrents.append(torrent); - } for (BitTorrent::Torrent *const torrent : asConst(torrents)) torrent->addTrackers(entries); @@ -1244,20 +1230,6 @@ void TorrentsController::removeTrackersAction() // remove trackers from all torrents torrents = BitTorrent::Session::instance()->torrents(); } - else if (hashParam.contains(u'|')) - { - // Don't want to enter `else` with a `hashParam` not an id - } - else - { - // remove trackers from specified torrent - const auto id = BitTorrent::TorrentID::fromString(hashParam); - BitTorrent::Torrent *const torrent = BitTorrent::Session::instance()->getTorrent(id); - if (!torrent) - throw APIError(APIErrorType::NotFound); - - torrents.append(torrent); - } for (BitTorrent::Torrent *const torrent : asConst(torrents)) torrent->removeTrackers(urls);