summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-05-04 18:25:09 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-05-04 18:25:09 +0200
commit8616402e568f036b7e91886e20dfa5748dc4517e (patch)
tree52cf3e81ee182a9a9b73f14ba376c1c9de5f43e8
parentbetter threadmanager (diff)
downloadpyload-8616402e568f036b7e91886e20dfa5748dc4517e.tar.xz
decrypt if downloadthreads are occupied
-rw-r--r--module/ThreadManager.py9
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"""