Fix #1510 - Cannot create a torrent with only non-zero tier trackers

This commit is contained in:
Calum Lind 2011-02-11 01:05:28 +00:00
parent 1d0857964e
commit 03689a805b
1 changed files with 3 additions and 6 deletions

View File

@ -283,14 +283,11 @@ class CreateTorrentDialog:
tracker = None tracker = None
else: else:
# Create a list of lists [[tier0, ...], [tier1, ...], ...] # Create a list of lists [[tier0, ...], [tier1, ...], ...]
tier_dict = {}
for tier, tracker in self.trackers_liststore: for tier, tracker in self.trackers_liststore:
try: tier_dict.setdefault(tier, []).append(tracker)
tier_list = trackers[tier]
except IndexError:
trackers.insert(tier, [])
trackers[tier].append(tracker)
trackers = [tier_dict[tier] for tier in sorted(tier_dict)]
# Get the first tracker in the first tier # Get the first tracker in the first tier
tracker = trackers[0][0] tracker = trackers[0][0]