Skip to content

Commit

Permalink
Correctly handle "torrent finished" events
Browse files Browse the repository at this point in the history
  • Loading branch information
glassez authored Nov 8, 2024
1 parent 4bec9b9 commit 33e3fb2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/base/bittorrent/sessionimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5238,9 +5238,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)
{
Expand Down Expand Up @@ -5535,6 +5532,9 @@ void SessionImpl::readAlerts()
}
}

// Some torrents may become "finished" after different alerts handling.
processPendingFinishedTorrents();

processTrackerStatuses();
}

Expand Down Expand Up @@ -6180,8 +6180,6 @@ void SessionImpl::handleStateUpdateAlert(const lt::state_update_alert *alert)
if (!updatedTorrents.isEmpty())
emit torrentsUpdated(updatedTorrents);

processPendingFinishedTorrents();

if (m_needSaveTorrentsQueue)
saveTorrentsQueue();

Expand Down

0 comments on commit 33e3fb2

Please sign in to comment.