summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcos Pinto <markybob@dipconsultants.com>2007-10-16 02:26:49 +0000
committerMarcos Pinto <markybob@dipconsultants.com>2007-10-16 02:26:49 +0000
commitd07d25e18954f55fe11f3f5b2864bd417129cf08 (patch)
treea4f4e8454918d6437d2e8592da8050899eea2119
parent664877a7e6f63d25bffe45bd8efdc28ebe02dbf8 (diff)
downloaddeluge-d07d25e18954f55fe11f3f5b2864bd417129cf08.tar.gz
deluge-d07d25e18954f55fe11f3f5b2864bd417129cf08.tar.bz2
deluge-d07d25e18954f55fe11f3f5b2864bd417129cf08.zip
fix fastresume oops
-rw-r--r--src/core.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/core.py b/src/core.py
index 07855340e..ea6d1593b 100644
--- a/src/core.py
+++ b/src/core.py
@@ -859,13 +859,17 @@ class Manager:
# Apply per torrent prefs after torrent added to core
self.apply_prefs_per_torrent(unique_ID)
#remove fastresume for non-seed
- torrent_state = self.get_core_torrent_state(unique_ID, False)
- if not torrent_state['is_seed']:
- try:
- os.remove(self.unique_IDs[unique_ID].filename + ".fastresume")
- except:
- pass
-
+ try:
+ torrent_state = self.get_core_torrent_state(unique_ID)
+ except:
+ pass
+ else:
+ if not torrent_state['is_seed']:
+ try:
+ os.remove(self.unique_IDs[unique_ID].filename + ".fastresume")
+ except:
+ pass
+
# Remove torrents from core, unique_IDs and queue
to_delete = []
for unique_ID in self.unique_IDs.keys():
@@ -902,15 +906,7 @@ class Manager:
self.state.queue.append(torrent)
else:
self.state.queue.append(torrent)
- #remove fastresume for non-seed
- torrent_state = self.get_core_torrent_state(unique_ID, False)
- if not torrent_state['is_seed']:
- try:
- os.remove(self.unique_IDs[unique_ID].filename + ".fastresume")
- except:
- pass
-
# run through queue, remove those that no longer exists
to_delete = []
for torrent in self.state.queue: