fix: do not include sticky trackers in getTrackers

This commit is contained in:
ze0s 2025-01-12 12:42:20 +00:00
commit 5d903cab4f

View file

@ -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.