when a torrent finishes downloading, first rename/move the files (if there's a temp directory or .part suffix), then check to fire the completeness callback, then check to fire the ratio limit callback, then check to fire the done callback.

This commit is contained in:
Jordan Lee 2013-07-16 00:50:45 +00:00
parent ee130e773d
commit 7bcaf891d1
1 changed files with 7 additions and 4 deletions

View File

@ -2157,19 +2157,22 @@ tr_torrentRecheckCompleteness (tr_torrent * tor)
{
/* clear interested flag on all peers */
tr_peerMgrClearInterest (tor);
/* if completeness was TR_LEECH then the seed limit check will have been skipped in bandwidthPulse */
tr_torrentCheckSeedLimit (tor);
}
if (tor->currentDir == tor->incompleteDir)
tr_torrentSetLocation (tor, tor->downloadDir, true, NULL, NULL);
}
}
fireCompletenessChange (tor, completeness, wasRunning);
if (tr_torrentIsSeed (tor))
{
if (wasLeeching && wasRunning)
{
/* if completeness was TR_LEECH then the seed limit check will have been skipped in bandwidthPulse */
tr_torrentCheckSeedLimit (tor);
}
if (tr_sessionIsTorrentDoneScriptEnabled (tor->session))
torrentCallScript (tor, tr_sessionGetTorrentDoneScript (tor->session));
}