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

@ -649,10 +649,13 @@ void TransferListWidget::recheckSelectedTorrents()
void TransferListWidget::reannounceSelectedTorrents() void TransferListWidget::reannounceSelectedTorrents()
{ {
for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents())) for (BitTorrent::Torrent *const torrent : asConst(getSelectedTorrents()))
{
if (!torrent->isStopped())
{ {
torrent->forceReannounce(); torrent->forceReannounce();
torrent->forceDHTAnnounce(); torrent->forceDHTAnnounce();
} }
}
} }
int TransferListWidget::visibleColumnsCount() const int TransferListWidget::visibleColumnsCount() const

View file

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