mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-20 16:43:43 +00:00
Fix for curRegex called before assignment issue that was pointed out to us.
This commit is contained in:
parent
95d7d728e0
commit
a65e68837c
1 changed files with 2 additions and 4 deletions
|
@ -201,19 +201,17 @@ def isGoodResult(name, show, log=True):
|
|||
escaped_name = re.sub('\\\\[\\s.-]', '\W+', re.escape(curName))
|
||||
if show.startyear:
|
||||
escaped_name += "(?:\W+" + str(show.startyear) + ")?"
|
||||
curRegex = '^' + escaped_name + '\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))'
|
||||
curRegex = '^' + escaped_name + '\W+(?:(?:S\d[\dE._ -])|(?:\d\d?x)|(?:\d{4}\W\d\d\W\d\d)|(?:(?:part|pt)[\._ -]?(\d|[ivx]))|Season\W+\d+\W+|E\d+\W+|(?:\d{1,3}.+\d{1,}[a-zA-Z]{2}\W+[a-zA-Z]{3,}\W+\d{4}.+))'
|
||||
if log:
|
||||
logger.log(u"Checking if show " + name + " matches " + curRegex, logger.DEBUG)
|
||||
|
||||
match = re.search(curRegex, name, re.I)
|
||||
|
||||
if match:
|
||||
logger.log(u"Matched " + curRegex + " to " + name, logger.DEBUG)
|
||||
return True
|
||||
|
||||
if log:
|
||||
logger.log(
|
||||
u"Provider gave result " + name + " but that doesn't seem like a valid result for " + show.name + " so I'm ignoring it")
|
||||
logger.log(u"Provider gave result " + name + " but that doesn't seem like a valid result for " + show.name + " so I'm ignoring it")
|
||||
return False
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue