From 8616402e568f036b7e91886e20dfa5748dc4517e Mon Sep 17 00:00:00 2001 From: mkaay Date: Tue, 4 May 2010 18:25:09 +0200 Subject: decrypt if downloadthreads are occupied --- module/ThreadManager.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/module/ThreadManager.py b/module/ThreadManager.py index ab0f99cfa..bb43bb1db 100644 --- a/module/ThreadManager.py +++ b/module/ThreadManager.py @@ -48,7 +48,7 @@ class ThreadManager(Thread): def run(self): while True: - if len(self.threads) < int(self.parent.config['general']['max_downloads']) and not self.pause: + if not self.pause and (len(self.threads) < int(self.parent.config['general']['max_downloads']) or self.isDecryptWaiting()): job = self.getJob() if job: thread = self.createThread(job) @@ -96,6 +96,13 @@ class ThreadManager(Thread): self.lock.release() return pyfile + + def isDecryptWaiting(self): + pyfiles = self.list.getDownloadList(self.occ_plugins) + for pyfile in pyfiles: + if pyfile.plugin.props['type'] == "container": + return True + return False def jobFinished(self, pyfile): """manage completing download""" -- cgit v1.2.3