mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03:00
Don't pollute move queue by torrents w/o metadata
There's really nothing to move if the torrent still doesn't have metadata. Additionally, such torrents in the queue can lead to unexpected behavior when reloading the torrent after metadata is received. PR #17823.
This commit is contained in:
parent
4e140098ed
commit
9b267690cc
1 changed files with 9 additions and 0 deletions
|
@ -501,6 +501,9 @@ void TorrentImpl::setAutoTMMEnabled(bool enabled)
|
||||||
|
|
||||||
QString TorrentImpl::actualStorageLocation() const
|
QString TorrentImpl::actualStorageLocation() const
|
||||||
{
|
{
|
||||||
|
if (!hasMetadata())
|
||||||
|
return {};
|
||||||
|
|
||||||
return Utils::Fs::toUniformPath(QString::fromStdString(m_nativeStatus.save_path));
|
return Utils::Fs::toUniformPath(QString::fromStdString(m_nativeStatus.save_path));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1634,6 +1637,12 @@ void TorrentImpl::resume(const TorrentOperatingMode mode)
|
||||||
|
|
||||||
void TorrentImpl::moveStorage(const QString &newPath, const MoveStorageMode mode)
|
void TorrentImpl::moveStorage(const QString &newPath, const MoveStorageMode mode)
|
||||||
{
|
{
|
||||||
|
if (!hasMetadata())
|
||||||
|
{
|
||||||
|
m_session->handleTorrentSavePathChanged(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (m_session->addMoveTorrentStorageJob(this, Utils::Fs::toNativePath(newPath), mode))
|
if (m_session->addMoveTorrentStorageJob(this, Utils::Fs::toNativePath(newPath), mode))
|
||||||
{
|
{
|
||||||
m_storageIsMoving = true;
|
m_storageIsMoving = true;
|
||||||
|
|
Loading…
Reference in a new issue