From db76205737c878f55e097343b735c3f01ff9d64d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 11 Jan 2007 14:20:15 +0000 Subject: [PATCH] --- deluge.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/deluge.py b/deluge.py index 43fd97fe1..7bb895350 100644 --- a/deluge.py +++ b/deluge.py @@ -584,8 +584,8 @@ class Manager: if torrent not in torrents_with_unique_ID: # print "Adding torrent to core:", torrent.filename, torrent.save_dir, torrent.compact unique_ID = deluge_core.add_torrent(torrent.filename, - torrent.save_dir, - torrent.compact) + torrent.save_dir, + torrent.compact) # print "Got unique ID:", unique_ID ret = unique_ID self.unique_IDs[unique_ID] = torrent @@ -593,10 +593,9 @@ class Manager: print torrents_with_unique_ID # Remove torrents from core, unique_IDs and queue to_delete = [] - for torrent in self.state.torrents: - print torrent - if torrent.delete_me: - unique_ID = torrents_with_unique_ID.index(torrent) + for unique_ID in self.unique_IDs.keys(): +# print torrent + if self.unique_IDs[unique_ID].delete_me: deluge_core.remove_torrent(unique_ID) to_delete.append(unique_ID) @@ -606,7 +605,7 @@ class Manager: del self.unique_IDs[unique_ID] # Add torrents to queue - at the end, of course - for unique_ID in self.unique_IDs: + for unique_ID in self.unique_IDs.keys(): if unique_ID not in self.state.queue: self.state.queue.append(unique_ID)