Add torrents with .fastresume files before torrents that don't during

state load.
This commit is contained in:
Andrew Resch 2008-03-06 08:09:47 +00:00
parent 3ff2af0f2a
commit 98b026f155
1 changed files with 10 additions and 3 deletions

View File

@ -271,10 +271,17 @@ class Manager:
if isinstance(state.torrents, list):
# One time convert of old torrents list to dict
state.torrents = dict((x, None) for x in
state.torrents)
# Add torrents to core and unique_IDs
state.torrents = dict((x, None) for x in state.torrents)
fr_sorted = []
for torrent in state.torrents:
if os.path.exists(torrent.filename + ".fastresume")
fr_sorted.insert(0, torrent)
else:
fr_sorted.append(torrent)
# Add torrents to core and unique_IDs
for torrent in fr_sorted:
if not os.path.exists(torrent.filename):
print "Missing file: %s" % torrent.filename
continue