deal with blank trackers in force recheck and between sessions

This commit is contained in:
Marcos Pinto 2007-11-16 20:56:50 +00:00
parent 5a90e14794
commit b764486bff
2 changed files with 9 additions and 3 deletions

View File

@ -169,6 +169,7 @@ class torrent_info:
self.webseed_urls = []
self.desired_ratio = 1.0
self.trackers = ""
self.trackers_changed = 0
self.delete_me = False # set this to true, to delete it on next sync
self.del_data = False # set this to true, to delete data on next sync
@ -1017,6 +1018,7 @@ of HD space! Oops!\nWe had to pause at least one torrent"))
def replace_trackers(self, unique_ID, trackerslist):
self.unique_IDs[unique_ID].trackers = trackerslist
self.unique_IDs[unique_ID].trackers_changed = 1
try:
return deluge_core.replace_trackers(unique_ID, trackerslist)
except:

View File

@ -170,7 +170,7 @@ class DelugeGTK:
self.manager.unique_IDs[unique_ID].initial_uploaded_memory = \
self.manager.unique_IDs[unique_ID].uploaded_memory
try:
if self.manager.unique_IDs[unique_ID].trackers:
if self.manager.unique_IDs[unique_ID].trackers_changed:
try:
self.manager.replace_trackers(unique_ID, \
self.manager.unique_IDs[unique_ID].trackers)
@ -747,11 +747,15 @@ window, please enter your password"))
path = self.manager.unique_IDs[uid].filename
save_dir = self.manager.unique_IDs[uid].save_dir
trackerslist = self.manager.unique_IDs[uid].trackers
try:
trackers_changed = self.manager.unique_IDs[uid].trackers_changed
except AttributeError:
trackers_changed = 0
self.manager.save_upmem()
uploaded_memory = self.manager.unique_IDs[uid].uploaded_memory
priorities = self.manager.get_priorities(uid)
save_info = [path, save_dir, order, trackerslist, \
uploaded_memory, priorities]
uploaded_memory, priorities, trackers_changed]
try:
os.remove(self.manager.unique_IDs[uid].filename + ".fastresume")
except:
@ -768,7 +772,7 @@ window, please enter your password"))
self.manager.unique_IDs[unique_ID].initial_uploaded_memory = \
save_info[4]
self.manager.save_upmem()
if save_info[3]:
if save_info[5]:
try:
self.manager.replace_trackers(unique_ID, save_info[3])
except: