From 2c8d1c3b562e43f02064c1c70ca763751ad38e64 Mon Sep 17 00:00:00 2001 From: Vuolter Date: Mon, 20 May 2013 23:57:14 +0200 Subject: Version 0.06: improved filename recognition (big thanks to stickell) --- module/plugins/hooks/SkipRev.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module/plugins/hooks/SkipRev.py') diff --git a/module/plugins/hooks/SkipRev.py b/module/plugins/hooks/SkipRev.py index 9e9f1af64..dccb153d8 100644 --- a/module/plugins/hooks/SkipRev.py +++ b/module/plugins/hooks/SkipRev.py @@ -19,12 +19,12 @@ from module.plugins.Hook import Hook from os.path import basename -from re import group, search +from re import search class SkipRev(Hook): __name__ = "SkipRev" - __version__ = "0.05" + __version__ = "0.06" __description__ = "Skip download when filename has rev extension" __config__ = [ ("activated", "bool", "Activated", "False"), @@ -38,8 +38,8 @@ class SkipRev(Hook): name = basename(pyfile.name) if name.endswith(".rev"): number = self.getConfig("number") - part = search('(\.part(.+?)\.rev)*$', name).group(2) - if int(part) <= number: + part = search(r'\.part(\d+)\.rev$', name) + if not part or int(part.group(1)) <= number: return self.logInfo("Skipping " + name) pyfile.setStatus("skipped") -- cgit v1.2.3