Remove workaround for lt 0.15 when setting the trackers

This commit is contained in:
Andrew Resch 2010-01-10 20:17:59 +00:00
parent 623c5ab57b
commit f586b91a59

View File

@ -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():