mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-27 03:36:16 +00:00
pause torrents during blocklist loading and then resume the ones that werent paused to begin with
This commit is contained in:
parent
d793835a7e
commit
f4bd67c320
@ -54,6 +54,12 @@ class BlocklistImport:
|
||||
self.gtkconf = GTKConfig(self)
|
||||
self.gtkprog = GTKProgress(self)
|
||||
self.nimported = 0
|
||||
# Stop all torrents
|
||||
self.paused_or_not = {}
|
||||
for unique_ID in self.core.unique_IDs:
|
||||
self.paused_or_not[unique_ID] = self.core.is_user_paused(unique_ID)
|
||||
if not self.paused_or_not[unique_ID]:
|
||||
self.core.set_user_pause(unique_ID, True, enforce_queue=False)
|
||||
|
||||
self.blockfile = deluge.common.CONFIG_DIR + "/blocklist.cache"
|
||||
|
||||
@ -72,7 +78,7 @@ class BlocklistImport:
|
||||
|
||||
def loadlist(self, fetch=False):
|
||||
self.gtkprog.start()
|
||||
|
||||
|
||||
# Attempt initial import
|
||||
if fetch:
|
||||
print "Fetching",self.config.get('url')
|
||||
@ -126,6 +132,10 @@ class BlocklistImport:
|
||||
|
||||
self.gtkprog.stop()
|
||||
self.cancelled = False
|
||||
#restart torrents that werent paused by us
|
||||
for unique_ID in self.core.unique_IDs:
|
||||
if not self.paused_or_not[unique_ID]:
|
||||
self.core.set_user_pause(unique_ID, False, enforce_queue=False)
|
||||
|
||||
def configure(self, window):
|
||||
self.gtkconf.start(self.config.get('listtype'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user