Add torrents with .fastresume files before torrents that don't during
state load.
This commit is contained in:
parent
3ff2af0f2a
commit
98b026f155
13
src/core.py
13
src/core.py
|
@ -271,10 +271,17 @@ class Manager:
|
||||||
|
|
||||||
if isinstance(state.torrents, list):
|
if isinstance(state.torrents, list):
|
||||||
# One time convert of old torrents list to dict
|
# One time convert of old torrents list to dict
|
||||||
state.torrents = dict((x, None) for x in
|
state.torrents = dict((x, None) for x in state.torrents)
|
||||||
state.torrents)
|
|
||||||
# Add torrents to core and unique_IDs
|
fr_sorted = []
|
||||||
for torrent in state.torrents:
|
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):
|
if not os.path.exists(torrent.filename):
|
||||||
print "Missing file: %s" % torrent.filename
|
print "Missing file: %s" % torrent.filename
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue