From 98b026f15560b19cd0e29e66c425c51c3a750941 Mon Sep 17 00:00:00 2001 From: Andrew Resch Date: Thu, 6 Mar 2008 08:09:47 +0000 Subject: [PATCH] Add torrents with .fastresume files before torrents that don't during state load. --- src/core.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core.py b/src/core.py index 7de724659..b1d80788e 100644 --- a/src/core.py +++ b/src/core.py @@ -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