diff --git a/libtransmission/resume.c b/libtransmission/resume.c index 30d5e952c..9a56b7f77 100644 --- a/libtransmission/resume.c +++ b/libtransmission/resume.c @@ -675,7 +675,7 @@ tr_torrentSaveResume (tr_torrent * tor) tr_variantDictAddInt (&top, TR_KEY_uploaded, tor->uploadedPrev + tor->uploadedCur); tr_variantDictAddInt (&top, TR_KEY_max_peers, tor->maxConnectedPeers); tr_variantDictAddInt (&top, TR_KEY_bandwidth_priority, tr_torrentGetPriority (tor)); - tr_variantDictAddBool (&top, TR_KEY_paused, !tor->isRunning); + tr_variantDictAddBool (&top, TR_KEY_paused, !tor->isRunning && !tor->isQueued); savePeers (&top, tor); if (tr_torrentHasMetadata (tor)) { @@ -778,7 +778,7 @@ loadFromFile (tr_torrent * tor, uint64_t fieldsToLoad) if ((fieldsToLoad & TR_FR_RUN) && tr_variantDictFindBool (&top, TR_KEY_paused, &boolVal)) { - tor->isRunning = !boolVal && !tor->isQueued; + tor->isRunning = !boolVal; fieldsLoaded |= TR_FR_RUN; } diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 57eecdc45..ffe82f067 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -1864,7 +1864,6 @@ stopTorrent (void * vtor) tr_torrentLock (tor); tr_verifyRemove (tor); - torrentSetQueued (tor, false); tr_peerMgrStopTorrent (tor); tr_announcerTorrentStopped (tor); tr_cacheFlushTorrent (tor->session->cache, tor); @@ -1874,6 +1873,8 @@ stopTorrent (void * vtor) if (!tor->isDeleting) tr_torrentSave (tor); + torrentSetQueued (tor, false); + tr_torrentUnlock (tor); } @@ -3543,6 +3544,7 @@ torrentSetQueued (tr_torrent * tor, bool queued) { tor->isQueued = queued; tor->anyDate = tr_time (); + tr_torrentSetDirty (tor); } }