From 5d903cab4f786212be4a6ec6cc17e184b2a11ee4 Mon Sep 17 00:00:00 2001 From: ze0s <43699394+zze0s@users.noreply.github.com> Date: Sun, 12 Jan 2025 12:42:20 +0000 Subject: [PATCH] fix: do not include sticky trackers in getTrackers --- src/webui/api/torrentscontroller.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index e01d39fbb..8cc389331 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -251,7 +251,7 @@ namespace QJsonArray getTrackers(const BitTorrent::Torrent *const torrent) { - QJsonArray trackerList = getStickyTrackers(torrent); + QJsonArray trackerList; for (const BitTorrent::TrackerEntryStatus &tracker : asConst(torrent->trackers())) { @@ -566,7 +566,14 @@ void TorrentsController::trackersAction() if (!torrent) throw APIError(APIErrorType::NotFound); - setResult(getTrackers(torrent)); + QJsonArray trackersList = getStickyTrackers(torrent); + QJsonArray trackers = getTrackers(torrent); + + // merge QJsonArray + for (auto &&tracker : trackers) + trackersList.append(std::move(tracker)); + + setResult(trackersList); } // Returns the web seeds for a torrent in JSON format.