diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-03-06 03:45:46 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-03-06 03:45:46 +0100 |
commit | cb52389931917fee9a6116b45922f502480350d6 (patch) | |
tree | b7063d2017e31c0f9c32f5ff2193036ea28f00e7 /module | |
parent | [SkipRev] Fix https://github.com/pyload/pyload/issues/1217 (diff) | |
download | pyload-cb52389931917fee9a6116b45922f502480350d6.tar.xz |
[SkipRev] Fix setup loop on download preparing
Diffstat (limited to 'module')
-rw-r--r-- | module/plugins/hooks/SkipRev.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 3ebfa378e..a543ef71c 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -18,7 +18,7 @@ def _setup(self): class SkipRev(Hook): __name__ = "SkipRev" __type__ = "hook" - __version__ = "0.26" + __version__ = "0.27" __config__ = [("mode" , "Auto;Manual", "Choose rev files to keep for package", "Auto"), ("tokeep", "int" , "Custom number of files to keep" , 0 )] @@ -57,7 +57,7 @@ class SkipRev(Hook): def downloadPreparing(self, pyfile): name = self._name(pyfile) - if pyfile.statusname is "unskipped" or not name.endswith(".rev") or not '.part' in name: + if pyfile.statusname is "unskipped" or not name.endswith(".rev") or not ".part" in name: return tokeep = -1 if self.getConfig('mode') == "Auto" else self.getConfig('tokeep') @@ -73,8 +73,10 @@ class SkipRev(Hook): return pyfile.setCustomStatus("SkipRev", "skipped") - pyfile.plugin._setup = pyfile.plugin.setup - pyfile.plugin.setup = MethodType(_setup, pyfile.plugin) #: work-around: inject status checker inside the preprocessing routine of the plugin + + if not hasattr(pyfile.plugin, "_setup"): + pyfile.plugin._setup = pyfile.plugin.setup + pyfile.plugin.setup = MethodType(_setup, pyfile.plugin) #: work-around: inject status checker inside the preprocessing routine of the plugin def downloadFailed(self, pyfile): |