From 1d74a9dcb91d16929a65a24d81ec441874ce4976 Mon Sep 17 00:00:00 2001 From: mkaay Date: Fri, 5 Nov 2010 16:45:06 +0100 Subject: sj fix --- module/PluginThread.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'module/PluginThread.py') diff --git a/module/PluginThread.py b/module/PluginThread.py index 20cb10a5b..f12639719 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -308,7 +308,12 @@ class DecrypterThread(PluginThread): pyfile = self.active retry = False - + + if not self.active.plugin.multiDL: + while self.m.isOccupiedCrypter(self.active.pluginname): + sleep(0.5) + self.m.addOccupiedCrypter(self.active.pluginname) + try: self.m.log.info(_("Decrypting starts: %s") % self.active.name) self.active.plugin.preprocessing(self) @@ -343,6 +348,8 @@ class DecrypterThread(PluginThread): self.m.log.info(_("Retrying %s") % self.active.name) retry = True + if not self.active.plugin.multiDL: + self.m.removeOccupiedCrypter(pyfile.pluginname) return self.run() except Exception, e: @@ -360,6 +367,8 @@ class DecrypterThread(PluginThread): finally: if not retry: + if not self.active.plugin.multiDL: + self.m.removeOccupiedCrypter(pyfile.pluginname) self.active.release() self.active = False self.m.core.files.save() -- cgit v1.2.3