mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-02-02 01:44:26 +00:00
- Save fastresume fata when pausing torrents to speed up qBittorrent shutdown
This commit is contained in:
parent
25adf6b061
commit
282d0a4af6
@ -787,7 +787,7 @@ void bittorrent::saveFastResumeData() {
|
|||||||
std::vector<torrent_handle>::iterator torrentIT;
|
std::vector<torrent_handle>::iterator torrentIT;
|
||||||
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
||||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
||||||
if(!h.is_valid() || !h.has_metadata()) continue;
|
if(!h.is_valid() || !h.has_metadata() || 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) continue;
|
||||||
h.save_resume_data();
|
h.save_resume_data();
|
||||||
++num_resume_data;
|
++num_resume_data;
|
||||||
|
@ -319,6 +319,7 @@ void QTorrentHandle::pause() {
|
|||||||
Q_ASSERT(h.is_valid());
|
Q_ASSERT(h.is_valid());
|
||||||
h.auto_managed(false);
|
h.auto_managed(false);
|
||||||
h.pause();
|
h.pause();
|
||||||
|
h.save_resume_data();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QTorrentHandle::resume() {
|
void QTorrentHandle::resume() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user