Correctly handle "torrent finished" events

PR #21786.
Closes #21699.
This commit is contained in:
Vladimir Golovnev 2024-11-08 11:45:57 +03:00 committed by Vladimir Golovnev (Glassez)
parent 39b965af48
commit 330dce6aa2
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7

View file

@ -5230,9 +5230,6 @@ void SessionImpl::handleMoveTorrentStorageJobFinished(const Path &newPath)
if (torrent)
{
torrent->handleMoveStorageJobFinished(newPath, finishedJob.context, torrentHasOutstandingJob);
// The torrent may become "finished" at the end of the move if it was moved
// from the "incomplete" location after downloading finished.
processPendingFinishedTorrents();
}
else if (!torrentHasOutstandingJob)
{
@ -5527,6 +5524,9 @@ void SessionImpl::readAlerts()
}
}
// Some torrents may become "finished" after different alerts handling.
processPendingFinishedTorrents();
processTrackerStatuses();
}
@ -6166,8 +6166,6 @@ void SessionImpl::handleStateUpdateAlert(const lt::state_update_alert *alert)
if (!updatedTorrents.isEmpty())
emit torrentsUpdated(updatedTorrents);
processPendingFinishedTorrents();
if (m_needSaveTorrentsQueue)
saveTorrentsQueue();