1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

(trunk, libT) #5427 'torrents start in pause' -- fix resume issue with que_restart_v2 patch by cfpp2p

This commit is contained in:
Jordan Lee 2013-10-20 17:15:19 +00:00
parent c79a5a191f
commit 451d398aa6
2 changed files with 5 additions and 3 deletions

View file

@ -675,7 +675,7 @@ tr_torrentSaveResume (tr_torrent * tor)
tr_variantDictAddInt (&top, TR_KEY_uploaded, tor->uploadedPrev + tor->uploadedCur); tr_variantDictAddInt (&top, TR_KEY_uploaded, tor->uploadedPrev + tor->uploadedCur);
tr_variantDictAddInt (&top, TR_KEY_max_peers, tor->maxConnectedPeers); tr_variantDictAddInt (&top, TR_KEY_max_peers, tor->maxConnectedPeers);
tr_variantDictAddInt (&top, TR_KEY_bandwidth_priority, tr_torrentGetPriority (tor)); 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); savePeers (&top, tor);
if (tr_torrentHasMetadata (tor)) if (tr_torrentHasMetadata (tor))
{ {
@ -778,7 +778,7 @@ loadFromFile (tr_torrent * tor, uint64_t fieldsToLoad)
if ((fieldsToLoad & TR_FR_RUN) if ((fieldsToLoad & TR_FR_RUN)
&& tr_variantDictFindBool (&top, TR_KEY_paused, &boolVal)) && tr_variantDictFindBool (&top, TR_KEY_paused, &boolVal))
{ {
tor->isRunning = !boolVal && !tor->isQueued; tor->isRunning = !boolVal;
fieldsLoaded |= TR_FR_RUN; fieldsLoaded |= TR_FR_RUN;
} }

View file

@ -1864,7 +1864,6 @@ stopTorrent (void * vtor)
tr_torrentLock (tor); tr_torrentLock (tor);
tr_verifyRemove (tor); tr_verifyRemove (tor);
torrentSetQueued (tor, false);
tr_peerMgrStopTorrent (tor); tr_peerMgrStopTorrent (tor);
tr_announcerTorrentStopped (tor); tr_announcerTorrentStopped (tor);
tr_cacheFlushTorrent (tor->session->cache, tor); tr_cacheFlushTorrent (tor->session->cache, tor);
@ -1874,6 +1873,8 @@ stopTorrent (void * vtor)
if (!tor->isDeleting) if (!tor->isDeleting)
tr_torrentSave (tor); tr_torrentSave (tor);
torrentSetQueued (tor, false);
tr_torrentUnlock (tor); tr_torrentUnlock (tor);
} }
@ -3543,6 +3544,7 @@ torrentSetQueued (tr_torrent * tor, bool queued)
{ {
tor->isQueued = queued; tor->isQueued = queued;
tor->anyDate = tr_time (); tor->anyDate = tr_time ();
tr_torrentSetDirty (tor);
} }
} }