With
r14136 I did not see consistently torrents starting in "waiting
mode/queue" instead of pause after a restart. Frequently queued torrents
still ended up paused. Attached patch que_restart.diff fixes this for
me. This still does not fix the queue order after a restart.
Code: Select all
Index: resume.c
===================================================================
--- resume.c (revision 14206)
+++ resume.c (working copy)
@@ -675,7 +675,7 @@
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 @@
if ((fieldsToLoad & TR_FR_RUN)
&& tr_variantDictFindBool (&top, TR_KEY_paused, &boolVal))
{
- tor->isRunning = !boolVal && !tor->isQueued;
+ tor->isRunning = !boolVal;
fieldsLoaded |= TR_FR_RUN;
}
Index: torrent.c
===================================================================
--- torrent.c (revision 14206)
+++ torrent.c (working copy)
@@ -1864,7 +1864,6 @@
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 @@
if (!tor->isDeleting)
tr_torrentSave (tor);
+ torrentSetQueued (tor, false);
+
tr_torrentUnlock (tor);
}
@@ -3543,6 +3544,7 @@
{
tor->isQueued = queued;
tor->anyDate = tr_time ();
+ tr_torrentSetDirty (tor);
}
}