From e70a09b6e45e2123d6efcca200f45864a990255d Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Mon, 12 May 2008 12:41:45 +0000 Subject: [PATCH] Fix queue order on restart. --- src/core.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core.py b/src/core.py index f1a8c8f21..6dec828f4 100644 --- a/src/core.py +++ b/src/core.py @@ -304,6 +304,7 @@ class Manager: # Make sure the Queue is in the correct order and remove any # entries that were not added to the session due to error. self.state.queue = state.queue[:] + for uid in state.queue: if uid not in self.state.torrents: self.state.queue.remove(uid) @@ -350,7 +351,7 @@ class Manager: print "save uploaded memory" import copy state = persistent_state() - state.queue = self.state.queue + state.queue = self.state.queue[:] for torrent in self.state.torrents: uid = self.state.torrents[torrent] @@ -361,6 +362,7 @@ class Manager: except AttributeError: t.uploaded_memory = 0 state.torrents[t] = uid + state.queue[state.queue.index(torrent)] = t # Pickle the state so if we experience a crash, the latest state is # available