From 2fb6bb00bf65151b111131f69ffa4d34105acc5c Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Wed, 20 Apr 2016 11:36:07 +0300 Subject: [PATCH] Fix rechecking after torrent is finished --- src/base/bittorrent/torrenthandle.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 2db90d8c6..db006aefe 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -1491,13 +1491,19 @@ void TorrentHandle::handleTorrentFinishedAlert(libtorrent::torrent_finished_aler m_hasSeedStatus = true; adjustActualSavePath(); - if (Preferences::instance()->recheckTorrentsOnCompletion()) - forceRecheck(); + appendExtensionsToIncompleteFiles(); - if (isMoveInProgress() || m_renameCount > 0) + const bool recheckTorrentsOnCompletion = Preferences::instance()->recheckTorrentsOnCompletion(); + if (isMoveInProgress() || m_renameCount > 0) { + if (recheckTorrentsOnCompletion) + m_moveFinishedTriggers.append(boost::bind(&TorrentHandle::forceRecheck, this)); m_moveFinishedTriggers.append(boost::bind(&Session::handleTorrentFinished, m_session, this)); - else + } + else { + if (recheckTorrentsOnCompletion) + forceRecheck(); m_session->handleTorrentFinished(this); + } } void TorrentHandle::handleTorrentPausedAlert(libtorrent::torrent_paused_alert *p)