Do not force_reannounce if 0 trackers.

This commit is contained in:
Andrew Resch 2007-11-17 02:13:43 +00:00
parent eac95882d4
commit b871ae8152

View File

@ -316,9 +316,10 @@ class TorrentManager:
def set_trackers(self, torrent_id, trackers):
"""Sets trackers"""
if trackers == [] or trackers == None:
return
log.debug("Setting trackers for %s", torrent_id)
if trackers == None:
trackers = []
log.debug("Setting trackers for %s: %s", torrent_id, trackers)
tracker_list = []
for tracker in trackers:
@ -332,7 +333,8 @@ class TorrentManager:
log.debug("tier: %s tracker: %s", t.tier, t.url)
# Set the tracker list in the torrent object
self.torrents[torrent_id].trackers = trackers
# Force a reannounce
if len(trackers) > 0:
# Force a reannounce if there is at least 1 tracker
self.force_reannounce(torrent_id)
def force_reannounce(self, torrent_id):