diff options
-rw-r--r-- | module/ThreadManager.py | 9 |
1 files changed, 8 insertions, 1 deletions
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""" |