diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 123a582d3..4829cd705 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -1116,6 +1116,13 @@ void bittorrent::readAlerts() { qDebug("Received finished alert for %s", h.name().toUtf8().data()); } } + if (torrent_paused_alert* p = dynamic_cast(a.get())) { + QTorrentHandle h(p->handle); + if(h.is_valid()){ + h.save_resume_data(); + qDebug("Received paused alert for %s", h.name().toUtf8().data()); + } + } else if (save_resume_data_alert* p = dynamic_cast(a.get())) { QDir torrentBackup(misc::qBittorrentPath() + "BT_backup"); QTorrentHandle h(p->handle); diff --git a/src/qtorrenthandle.cpp b/src/qtorrenthandle.cpp index fba68471d..b3044105c 100644 --- a/src/qtorrenthandle.cpp +++ b/src/qtorrenthandle.cpp @@ -319,7 +319,6 @@ void QTorrentHandle::pause() { Q_ASSERT(h.is_valid()); h.auto_managed(false); h.pause(); - h.save_resume_data(); } void QTorrentHandle::resume() {