From 52b54fe15439fa1da90308c84cf71be81cdf2a20 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Sun, 9 Jan 2022 21:14:49 +0300 Subject: [PATCH 1/2] Don't try to move storage into its current location --- src/base/bittorrent/torrentimpl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index 7782f8059..c29adb4c7 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -2074,7 +2074,8 @@ void TorrentImpl::adjustStorageLocation() const bool isFinished = isSeed() || m_hasSeedStatus; const QDir targetDir {((isFinished || downloadPath.isEmpty()) ? savePath() : downloadPath)}; - moveStorage(targetDir.absolutePath(), MoveStorageMode::Overwrite); + if ((targetDir != QDir(actualStorageLocation())) || isMoveInProgress()) + moveStorage(targetDir.absolutePath(), MoveStorageMode::Overwrite); } lt::torrent_handle TorrentImpl::nativeHandle() const From fbc85bed64d1637d66b0bb4ec028142dc76e7af0 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Mon, 10 Jan 2022 08:18:34 +0300 Subject: [PATCH 2/2] Move torrent immediately when "save path" is changed --- src/base/bittorrent/torrentimpl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrentimpl.cpp b/src/base/bittorrent/torrentimpl.cpp index c29adb4c7..bbc92f817 100644 --- a/src/base/bittorrent/torrentimpl.cpp +++ b/src/base/bittorrent/torrentimpl.cpp @@ -411,7 +411,7 @@ void TorrentImpl::setSavePath(const QString &path) m_session->handleTorrentNeedSaveResumeData(this); const bool isFinished = isSeed() || m_hasSeedStatus; - if (isFinished) + if (isFinished || downloadPath().isEmpty()) moveStorage(savePath(), MoveStorageMode::KeepExistingFiles); }