From 66f3cf7e67d7749b3dad06ecbee9442b88b2e3ba Mon Sep 17 00:00:00 2001 From: Thomas Piccirello <8296030+Piccirello@users.noreply.github.com> Date: Sun, 13 Jul 2025 06:39:29 -0700 Subject: [PATCH] Reannounce DHT when reannouncing all trackers PR #22953. --- src/gui/transferlistwidget.cpp | 3 +++ src/webui/api/torrentscontroller.cpp | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index 6fb71bfaa..f78dd8481 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -649,7 +649,10 @@ void TransferListWidget::recheckSelectedTorrents() void TransferListWidget::reannounceSelectedTorrents() { for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents())) + { torrent->forceReannounce(); + torrent->forceDHTAnnounce(); + } } int TransferListWidget::visibleColumnsCount() const diff --git a/src/webui/api/torrentscontroller.cpp b/src/webui/api/torrentscontroller.cpp index 9e9a4ebf6..bb3e98a31 100644 --- a/src/webui/api/torrentscontroller.cpp +++ b/src/webui/api/torrentscontroller.cpp @@ -1171,9 +1171,7 @@ void TorrentsController::editTrackerAction() throw APIError(APIErrorType::Conflict, u"Tracker not found"_s); torrent->replaceTrackers(entries); - - if (!torrent->isStopped()) - torrent->forceReannounce(); + torrent->forceReannounce(); setResult(QString()); } @@ -1620,7 +1618,11 @@ void TorrentsController::reannounceAction() requireParams({u"hashes"_s}); const QStringList hashes {params()[u"hashes"_s].split(u'|')}; - applyToTorrents(hashes, [](BitTorrent::Torrent *const torrent) { torrent->forceReannounce(); }); + applyToTorrents(hashes, [](BitTorrent::Torrent *const torrent) + { + torrent->forceReannounce(); + torrent->forceDHTAnnounce(); + }); setResult(QString()); }