Fix inserting into queue.

This commit is contained in:
Andrew Resch 2008-03-10 09:19:49 +00:00
parent 616fa74051
commit b5078571a2
1 changed files with 4 additions and 0 deletions

View File

@ -218,6 +218,10 @@ class TorrentQueue(component.Component):
if q == None:
self.queue[self.queue.index(q)] = torrent_id
return self.queue.index(q)
self.queue.append(torrent_id)
return self.queue.index(torrent_id)
else:
if position > (len(self.queue) - 1):
self.queue.insert(position, torrent_id)