From eceb66ac0426dc64be67b01466cbccfccde66ea7 Mon Sep 17 00:00:00 2001 From: ze0s <43699394+zze0s@users.noreply.github.com> Date: Sat, 11 Jan 2025 15:21:41 +0000 Subject: [PATCH] fix: always include sticky trackers --- src/webui/api/torrentscontroller.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index e4c388de4..e01d39fbb 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -249,12 +249,9 @@ namespace return {dht, pex, lsd}; } - QJsonArray getAllTrackers(const BitTorrent::Torrent *const torrent, const bool includeSticky) + QJsonArray getTrackers(const BitTorrent::Torrent *const torrent) { - QJsonArray trackerList; - - if (includeSticky) - trackerList << getStickyTrackers(torrent); + QJsonArray trackerList = getStickyTrackers(torrent); for (const BitTorrent::TrackerEntryStatus &tracker : asConst(torrent->trackers())) { @@ -369,7 +366,7 @@ void TorrentsController::infoAction() QVariantMap serializedTorrent = serialize(*torrent); if (includeTrackers) - serializedTorrent.insert(KEY_PROP_TRACKERS, getAllTrackers(torrent, false)); + serializedTorrent.insert(KEY_PROP_TRACKERS, getTrackers(torrent)); torrentList.append(serializedTorrent); } @@ -569,7 +566,7 @@ void TorrentsController::trackersAction() if (!torrent) throw APIError(APIErrorType::NotFound); - setResult(getAllTrackers(torrent, true)); + setResult(getTrackers(torrent)); } // Returns the web seeds for a torrent in JSON format.