Reannounce DHT when reannouncing all trackers

PR #22953.
This commit is contained in:
Thomas Piccirello
2025-07-13 06:39:29 -07:00
committed by GitHub
parent bf86592e8c
commit 66f3cf7e67
2 changed files with 9 additions and 4 deletions

View File

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

View File

@@ -1171,8 +1171,6 @@ void TorrentsController::editTrackerAction()
throw APIError(APIErrorType::Conflict, u"Tracker not found"_s);
torrent->replaceTrackers(entries);
if (!torrent->isStopped())
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());
}