diff options
author | Walter Purcaro <vuolter@gmail.com> | 2015-01-09 17:32:26 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2015-01-09 17:32:26 +0100 |
commit | 73b7584189b091006893f27ca91e79472ddb77ad (patch) | |
tree | a7d636c47d35071e05d670f0d347b63c446173f3 /module/plugins/hooks/SkipRev.py | |
parent | [MultiHook] Fix auto-deactivation (diff) | |
download | pyload-73b7584189b091006893f27ca91e79472ddb77ad.tar.xz |
[SkipRev] Improve file name grabbing
Diffstat (limited to 'module/plugins/hooks/SkipRev.py')
-rw-r--r-- | module/plugins/hooks/SkipRev.py | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index cc32c365e..ad6d7dacd 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.21" + __version__ = "0.22" __config__ = [("tokeep", "int", "Number of rev files to keep for package (-1 to auto)", -1)] @@ -33,23 +33,11 @@ class SkipRev(Hook): def _pyname(self, pyfile): - url = pyfile.url - plugin = pyfile.plugin - - if hasattr(plugin, "info") and 'name' in plugin.info and plugin.info['name']: - name = plugin.info['name'] - - elif hasattr(plugin, "parseInfos"): - name = next(plugin.parseInfos([url]))['name'] - - elif hasattr(plugin, "getInfo"): #@NOTE: if parseInfos was not found, getInfo should be missing too - name = plugin.getInfo(url)['name'] - + if hasattr(pyfile.pluginmodule, "getInfo"): + return getattr(pyfile.pluginmodule, "getInfo")([pyfile.url])[0][0] else: self.logWarning("Unable to grab file name") - name = urlparse(unquote(url)).path.split('/')[-1] - - return name + return urlparse(unquote(pyfile.url)).path.split('/')[-1] def _pyfile(self, link): |