Do not save fastresume files if torrent is being checked or is queued

for being checked.
This commit is contained in:
Andrew Resch 2008-02-10 14:03:22 +00:00
parent 27feb11ae8
commit 25295ee094
1 changed files with 6 additions and 1 deletions

View File

@ -459,7 +459,8 @@ class Manager:
def save_fastresume_data(self, uid=None): def save_fastresume_data(self, uid=None):
if uid == None: if uid == None:
for unique_ID in self.unique_IDs: for unique_ID in self.unique_IDs:
if not self.get_core_torrent_state(unique_ID, True)['is_seed']: state = self.get_core_torrent_state(unique_ID, True)
if not state['is_seed'] and state['state'] != 0 and state['state'] != 1:
try: try:
os.remove(self.unique_IDs[unique_ID].filename + ".fastresume") os.remove(self.unique_IDs[unique_ID].filename + ".fastresume")
except: except:
@ -469,6 +470,10 @@ class Manager:
except Exception, e: except Exception, e:
print "Unable to save fastresume: ", e print "Unable to save fastresume: ", e
else: else:
# Do not save fastresume if torrent is Queued for checking or being checked
state = self.get_core_torrent_state(uid, True)
if state['state'] == 0 or state['state'] == 1:
return
try: try:
os.remove(self.unique_IDs[uid].filename + ".fastresume") os.remove(self.unique_IDs[uid].filename + ".fastresume")
except: except: