mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-12 20:44:50 +00:00
Remove workaround for lt 0.15 when setting the trackers
This commit is contained in:
parent
623c5ab57b
commit
f586b91a59
@ -285,12 +285,9 @@ class Torrent:
|
||||
if trackers == None:
|
||||
trackers = []
|
||||
for value in self.handle.trackers():
|
||||
if lt.version_minor < 15:
|
||||
tracker = {}
|
||||
tracker["url"] = value.url
|
||||
tracker["tier"] = value.tier
|
||||
else:
|
||||
tracker = value
|
||||
tracker = {}
|
||||
tracker["url"] = value.url
|
||||
tracker["tier"] = value.tier
|
||||
trackers.append(tracker)
|
||||
self.trackers = trackers
|
||||
self.tracker_host = None
|
||||
@ -299,14 +296,11 @@ class Torrent:
|
||||
log.debug("Setting trackers for %s: %s", self.torrent_id, trackers)
|
||||
tracker_list = []
|
||||
|
||||
if lt.version_minor < 15:
|
||||
for tracker in trackers:
|
||||
new_entry = lt.announce_entry(tracker["url"])
|
||||
new_entry.tier = tracker["tier"]
|
||||
tracker_list.append(new_entry)
|
||||
self.handle.replace_trackers(tracker_list)
|
||||
else:
|
||||
self.handle.replace_trackers(trackers)
|
||||
for tracker in trackers:
|
||||
new_entry = lt.announce_entry(tracker["url"])
|
||||
new_entry.tier = tracker["tier"]
|
||||
tracker_list.append(new_entry)
|
||||
self.handle.replace_trackers(tracker_list)
|
||||
|
||||
# Print out the trackers
|
||||
#for t in self.handle.trackers():
|
||||
|
Loading…
x
Reference in New Issue
Block a user