From 7bcaf891d11f054077437e5d3fb6f6f95f871830 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Tue, 16 Jul 2013 00:50:45 +0000 Subject: [PATCH] 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. --- libtransmission/torrent.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index d914bf3f2..36a8996a4 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -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)); }