mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
(trunk, libT) #5427 'torrents start in pause' -- fix resume issue with que_restart_v2 patch by cfpp2p
This commit is contained in:
parent
c79a5a191f
commit
451d398aa6
2 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue