mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 13:23:34 -07:00
Save updated resume data for completed torrents
If fastresume data was rejected we need to save updated resume data after torrent finishes rechecking.
This commit is contained in:
parent
00d6c83ee5
commit
334b57a89a
2 changed files with 7 additions and 1 deletions
|
@ -188,6 +188,7 @@ TorrentHandle::TorrentHandle(Session *session, const libtorrent::torrent_handle
|
||||||
, m_ratioLimit(params.ratioLimit)
|
, m_ratioLimit(params.ratioLimit)
|
||||||
, m_seedingTimeLimit(params.seedingTimeLimit)
|
, m_seedingTimeLimit(params.seedingTimeLimit)
|
||||||
, m_tempPathDisabled(params.disableTempPath)
|
, m_tempPathDisabled(params.disableTempPath)
|
||||||
|
, m_fastresumeDataRejected(false)
|
||||||
, m_hasMissingFiles(false)
|
, m_hasMissingFiles(false)
|
||||||
, m_hasRootFolder(params.hasRootFolder)
|
, m_hasRootFolder(params.hasRootFolder)
|
||||||
, m_needsToSetFirstLastPiecePriority(false)
|
, m_needsToSetFirstLastPiecePriority(false)
|
||||||
|
@ -1588,6 +1589,8 @@ void TorrentHandle::handleTorrentCheckedAlert(const libtorrent::torrent_checked_
|
||||||
else {
|
else {
|
||||||
m_startupState = Started;
|
m_startupState = Started;
|
||||||
m_pauseWhenReady = false;
|
m_pauseWhenReady = false;
|
||||||
|
if (m_fastresumeDataRejected && !m_hasMissingFiles)
|
||||||
|
saveResumeData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1717,6 +1720,8 @@ void TorrentHandle::handleSaveResumeDataFailedAlert(const libtorrent::save_resum
|
||||||
|
|
||||||
void TorrentHandle::handleFastResumeRejectedAlert(const libtorrent::fastresume_rejected_alert *p)
|
void TorrentHandle::handleFastResumeRejectedAlert(const libtorrent::fastresume_rejected_alert *p)
|
||||||
{
|
{
|
||||||
|
m_fastresumeDataRejected = true;
|
||||||
|
|
||||||
if (p->error.value() == libt::errors::mismatching_file_size) {
|
if (p->error.value() == libt::errors::mismatching_file_size) {
|
||||||
// Mismatching file size (files were probably moved)
|
// Mismatching file size (files were probably moved)
|
||||||
m_hasMissingFiles = true;
|
m_hasMissingFiles = true;
|
||||||
|
@ -1724,7 +1729,7 @@ void TorrentHandle::handleFastResumeRejectedAlert(const libtorrent::fastresume_r
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LogMsg(tr("Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
|
LogMsg(tr("Fast resume data was rejected for torrent '%1'. Reason: %2. Checking again...")
|
||||||
.arg(name(), QString::fromStdString(p->message())), Log::CRITICAL);
|
.arg(name(), QString::fromStdString(p->message())), Log::WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -467,6 +467,7 @@ namespace BitTorrent
|
||||||
qreal m_ratioLimit;
|
qreal m_ratioLimit;
|
||||||
int m_seedingTimeLimit;
|
int m_seedingTimeLimit;
|
||||||
bool m_tempPathDisabled;
|
bool m_tempPathDisabled;
|
||||||
|
bool m_fastresumeDataRejected;
|
||||||
bool m_hasMissingFiles;
|
bool m_hasMissingFiles;
|
||||||
bool m_hasRootFolder;
|
bool m_hasRootFolder;
|
||||||
bool m_needsToSetFirstLastPiecePriority;
|
bool m_needsToSetFirstLastPiecePriority;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue