mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Allow "missing files" torrents to save more resume data
This commit is contained in:
parent
349e958be3
commit
ae3d17ec01
1 changed files with 13 additions and 1 deletions
|
@ -1565,7 +1565,19 @@ void TorrentImpl::handleTorrentResumedAlert(const lt::torrent_resumed_alert *p)
|
||||||
|
|
||||||
void TorrentImpl::handleSaveResumeDataAlert(const lt::save_resume_data_alert *p)
|
void TorrentImpl::handleSaveResumeDataAlert(const lt::save_resume_data_alert *p)
|
||||||
{
|
{
|
||||||
if (!m_hasMissingFiles)
|
if (m_hasMissingFiles)
|
||||||
|
{
|
||||||
|
const auto havePieces = m_ltAddTorrentParams.have_pieces;
|
||||||
|
const auto unfinishedPieces = m_ltAddTorrentParams.unfinished_pieces;
|
||||||
|
const auto verifiedPieces = m_ltAddTorrentParams.verified_pieces;
|
||||||
|
|
||||||
|
// Update recent resume data but preserve existing progress
|
||||||
|
m_ltAddTorrentParams = p->params;
|
||||||
|
m_ltAddTorrentParams.have_pieces = havePieces;
|
||||||
|
m_ltAddTorrentParams.unfinished_pieces = unfinishedPieces;
|
||||||
|
m_ltAddTorrentParams.verified_pieces = verifiedPieces;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// Update recent resume data
|
// Update recent resume data
|
||||||
m_ltAddTorrentParams = p->params;
|
m_ltAddTorrentParams = p->params;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue