diff options
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/ExternalScripts.py | 14 | ||||
-rw-r--r-- | module/plugins/hooks/UnRar.py | 1 |
2 files changed, 13 insertions, 2 deletions
diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 111b60d22..8d749b5bd 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -40,7 +40,8 @@ class ExternalScripts(Hook): join(pypath,'scripts','download_finished'), join(pypath,'scripts','package_finished'), join(pypath,'scripts','before_reconnect'), - join(pypath,'scripts','after_reconnect')] + join(pypath,'scripts','after_reconnect'), + join(pypath,'scripts','unrar_finished')] folder = core.path("scripts") @@ -56,6 +57,7 @@ class ExternalScripts(Hook): self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished'))) self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect'))) self.scripts['after_reconnect'] = filter(f, listdir(join(folder, 'after_reconnect'))) + self.scripts['unrar_finished'] = filter(f, listdir(join(folder, 'unrar_finished'))) for script_type, script_name in self.scripts.iteritems(): if script_name != []: @@ -103,6 +105,14 @@ class ExternalScripts(Hook): def afterReconnecting(self, ip): for script in self.scripts['after_reconnect']: try: - out = subprocess.Popen([join(self.folder, 'download_preparing', script), ip], stdout=subprocess.PIPE) + out = subprocess.Popen([join(self.folder, 'after_reconnect', script), ip], stdout=subprocess.PIPE) except: pass + + def unrarFinished(self, folder, fname): + for script in self.scripts["unrar_finished"]: + try: + out = subprocess.Popen([join(self.folder, 'unrar_finished', script), folder, fname], stdout=subprocess.PIPE) + except: + pass + diff --git a/module/plugins/hooks/UnRar.py b/module/plugins/hooks/UnRar.py index 88da0b64d..f47c08e89 100644 --- a/module/plugins/hooks/UnRar.py +++ b/module/plugins/hooks/UnRar.py @@ -161,6 +161,7 @@ class UnRar(Hook): if success: self.core.log.info(_("Unrar of %s ok") % fname) self.removeFiles(pack, fname) + self.core.hookManager.unrarFinished(folder, fname) else: self.core.log.info(_("Unrar of %s failed (wrong password)") % fname) finally: |