Immediately update torrent status on moving files

PR #19220.
This commit is contained in:
Vladimir Golovnev
2023-06-25 12:45:58 +03:00
committed by GitHub
parent c90863f217
commit 1c654d8f47
3 changed files with 15 additions and 2 deletions

View File

@@ -1779,8 +1779,12 @@ void TorrentImpl::moveStorage(const Path &newPath, const MoveStorageContext cont
? MoveStorageMode::Overwrite : MoveStorageMode::KeepExistingFiles;
if (m_session->addMoveTorrentStorageJob(this, newPath, mode, context))
{
m_storageIsMoving = true;
updateState();
if (!m_storageIsMoving)
{
m_storageIsMoving = true;
updateState();
m_session->handleTorrentStorageMovingStateChanged(this);
}
}
}
@@ -1813,6 +1817,9 @@ void TorrentImpl::handleMoveStorageJobFinished(const Path &path, const MoveStora
if (!m_storageIsMoving)
{
updateState();
m_session->handleTorrentStorageMovingStateChanged(this);
if (m_hasMissingFiles)
{
// it can be moved to the proper location