Browse Source

Merge pull request #16009 from glassez/dont-move-into-itself

Don't try to move storage into its current location
adaptive-webui-19844
Vladimir Golovnev 3 years ago committed by GitHub
parent
commit
709a053c7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      src/base/bittorrent/torrentimpl.cpp

5
src/base/bittorrent/torrentimpl.cpp

@ -411,7 +411,7 @@ void TorrentImpl::setSavePath(const QString &path) @@ -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);
}
@ -2074,7 +2074,8 @@ void TorrentImpl::adjustStorageLocation() @@ -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

Loading…
Cancel
Save