From abb6a680e360dadb927ede2a44df6779b605d048 Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Wed, 21 Feb 2007 01:23:25 +0000 Subject: [PATCH] patch to fix AssertionError bug on startup --- src/deluge.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/deluge.py b/src/deluge.py index f56aca8d6..720d2b4de 100644 --- a/src/deluge.py +++ b/src/deluge.py @@ -643,6 +643,14 @@ class Manager: for unique_ID in self.unique_IDs.keys(): if unique_ID not in self.state.queue: self.state.queue.append(unique_ID) + # run through queue, remove those that no longer exists + to_delete = [] + for queue_item in self.state.queue: + print "queue_item", queue_item + if queue_item not in self.unique_IDs.keys(): + to_delete.append(queue_item) + for del_item in to_delete: + self.state.queue.remove(del_item) assert(len(self.unique_IDs) == len(self.state.torrents))