Skip reannounce if torrent is stopped

This matches the behavior exhibited elsewhere, but was not consistently applied.
This commit is contained in:
Thomas Piccirello 2025-07-01 07:58:40 -07:00
commit ee4baa39c4
No known key found for this signature in database
2 changed files with 11 additions and 5 deletions

View file

@ -650,8 +650,11 @@ void TransferListWidget::reannounceSelectedTorrents()
{
for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents()))
{
torrent->forceReannounce();
torrent->forceDHTAnnounce();
if (!torrent->isStopped())
{
torrent->forceReannounce();
torrent->forceDHTAnnounce();
}
}
}

View file

@ -1621,9 +1621,12 @@ void TorrentsController::reannounceAction()
const QStringList hashes {params()[u"hashes"_s].split(u'|')};
applyToTorrents(hashes, [](BitTorrent::Torrent *const torrent)
{
torrent->forceReannounce();
torrent->forceDHTAnnounce();
});
if (!torrent->isStopped())
{
torrent->forceReannounce();
torrent->forceDHTAnnounce();
}
});
setResult(QString());
}