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 committed Nov 8, 2024
1 parent 39b965a commit 330dce6
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 @@ -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)
{
Expand Down Expand Up @@ -5527,6 +5524,9 @@ void SessionImpl::readAlerts()
}
}

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

processTrackerStatuses();
}

Expand Down Expand Up @@ -6166,8 +6166,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 330dce6

Please sign in to comment.