Browse Source

Allow "missing files" torrents to save more resume data

adaptive-webui-19844
Vladimir Golovnev (Glassez) 4 years ago
parent
commit
e273ac3a0d
No known key found for this signature in database
GPG Key ID: 52A2C7DEE2DFA6F7
  1. 14
      src/base/bittorrent/torrentimpl.cpp

14
src/base/bittorrent/torrentimpl.cpp

@ -1565,7 +1565,19 @@ void TorrentImpl::handleTorrentResumedAlert(const lt::torrent_resumed_alert *p) @@ -1565,7 +1565,19 @@ void TorrentImpl::handleTorrentResumedAlert(const lt::torrent_resumed_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
m_ltAddTorrentParams = p->params;

Loading…
Cancel
Save