1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-02-05 19:34:17 +00:00

Don't save resume data when torrent has an error. Prevents removing possibly useful .fastresume file and writing garbage.

This commit is contained in:
sledgehammer999 2013-10-01 00:37:34 +03:00
parent bbf47b0907
commit 6a45e9dbd7

View File

@ -1616,7 +1616,7 @@ void QBtSession::saveTempFastResumeData() {
#if LIBTORRENT_VERSION_NUM >= 001600 #if LIBTORRENT_VERSION_NUM >= 001600
if (!h.need_save_resume_data()) continue; if (!h.need_save_resume_data()) continue;
#endif #endif
if (h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) continue; if (h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking || h.has_error()) continue;
qDebug("Saving fastresume data for %s", qPrintable(h.name())); qDebug("Saving fastresume data for %s", qPrintable(h.name()));
h.save_resume_data(); h.save_resume_data();
}catch(std::exception e) {} }catch(std::exception e) {}
@ -1648,7 +1648,7 @@ void QBtSession::saveFastResumeData() {
continue; continue;
// Actually with should save fast resume data for paused files too // Actually with should save fast resume data for paused files too
//if (h.is_paused()) continue; //if (h.is_paused()) continue;
if (h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking) continue; if (h.state() == torrent_status::checking_files || h.state() == torrent_status::queued_for_checking || h.has_error()) continue;
h.save_resume_data(); h.save_resume_data();
++num_resume_data; ++num_resume_data;
} catch(libtorrent::invalid_handle&) {} } catch(libtorrent::invalid_handle&) {}