mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-11 05:33:37 +00:00
Fix for SHOWQUEUE-REFRESH
This commit is contained in:
parent
773ac7e9e1
commit
dfc600893d
2 changed files with 5 additions and 3 deletions
|
@ -120,8 +120,7 @@ class NameParser(object):
|
|||
if not name:
|
||||
return
|
||||
|
||||
self.showObj = None
|
||||
if not self.naming_pattern:
|
||||
if not self.showObj and not self.naming_pattern:
|
||||
# Regex pattern to return the Show / Series Name regardless of the file pattern tossed at it, matched 53 show name examples from regexes.py
|
||||
show_pattern = '''(?:(?:\[.*?\])|(?:\d{3}[\.-]))*[ _\.]?(?P<series_name>.*?(?:[ ._-]((?!\d{4}\W\d\d\W\d\d\W)\d{4}))?)(?:(?:(?:[ ._-]+\d+)|(?:[ ._-]+s\d{2}))|(?:\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}.+))))'''
|
||||
show_pattern_alt = '''^(?P<series_name>.*?(?:[ ._-]((?!\d{4}\W\d\d\W\d\d\W)\d{4}))?)(?:(?:(?:[ ._-]+\d+)|(?:[ ._-]+s\d{2}))|(?:\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}.+))))'''
|
||||
|
|
|
@ -618,11 +618,14 @@ class TVShow(object):
|
|||
logger.log(str(self.indexerid) + u": Creating episode object from " + file, logger.DEBUG)
|
||||
|
||||
try:
|
||||
myParser = NameParser(showObj=self, useIndexers=True)
|
||||
myParser = NameParser(True, showObj=self, useIndexers=True)
|
||||
parse_result = myParser.parse(file)
|
||||
except InvalidNameException:
|
||||
logger.log(u"Unable to parse the filename " + file + " into a valid episode", logger.ERROR)
|
||||
return None
|
||||
except InvalidShowException:
|
||||
logger.log(u"Unable to parse the filename " + file + " into a valid show", logger.WARNING)
|
||||
return None
|
||||
|
||||
if not len(parse_result.episode_numbers) and not (parse_result.air_by_date or parse_result.sports):
|
||||
logger.log("parse_result: " + str(parse_result))
|
||||
|
|
Loading…
Reference in a new issue