mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-29 12:45:45 +00:00
When loading state, add torrents with .fastresume files first to avoid
waiting for torrents to be checked.
This commit is contained in:
parent
7d5bd22855
commit
bcd5b2c458
@ -450,8 +450,19 @@ class TorrentManager(component.Component):
|
||||
# First lets clear the queue and make it the correct length.. This will
|
||||
# help with inserting values at the right position.
|
||||
self.queue.set_size(len(state.torrents))
|
||||
|
||||
|
||||
# Reorder the state.torrents list to add torrents with .fastresume files
|
||||
# first.
|
||||
fr_first = []
|
||||
for torrent_state in state.torrents:
|
||||
if os.path.exists(os.path.join(
|
||||
self.config["torrentfiles_location"],
|
||||
torrent_state.filename, ".fastresume")):
|
||||
fr_first.insert(0, torrent_state)
|
||||
else:
|
||||
fr_first.append(torrent_state)
|
||||
|
||||
for torrent_state in fr_first:
|
||||
try:
|
||||
options = {
|
||||
"compact_allocation": torrent_state.compact,
|
||||
|
Loading…
x
Reference in New Issue
Block a user