Restart "missing files" torrents after changing location

This commit is contained in:
Vladimir Golovnev (Glassez) 2021-02-06 14:59:51 +03:00 committed by sledgehammer999
commit 8210f9841e
No known key found for this signature in database
GPG key ID: 6E4A2D025B7CC9A2

View file

@ -1387,6 +1387,7 @@ void TorrentImpl::resume(const TorrentOperatingMode mode)
{
m_hasMissingFiles = false;
m_isStopped = false;
m_ltAddTorrentParams.ti = std::const_pointer_cast<lt::torrent_info>(m_nativeHandle.torrent_file());
reload();
updateStatus();
return;
@ -1446,8 +1447,21 @@ void TorrentImpl::handleMoveStorageJobFinished(const bool hasOutstandingJob)
saveResumeData();
while ((m_renameCount == 0) && !m_moveFinishedTriggers.isEmpty())
m_moveFinishedTriggers.takeFirst()();
if (!m_storageIsMoving)
{
if (m_hasMissingFiles)
{
// it can be moved to the proper location
m_hasMissingFiles = false;
m_ltAddTorrentParams.save_path = m_nativeStatus.save_path;
m_ltAddTorrentParams.ti = std::const_pointer_cast<lt::torrent_info>(m_nativeHandle.torrent_file());
reload();
updateStatus();
}
while ((m_renameCount == 0) && !m_moveFinishedTriggers.isEmpty())
m_moveFinishedTriggers.takeFirst()();
}
}
void TorrentImpl::handleTrackerReplyAlert(const lt::tracker_reply_alert *p)