diff --git a/sickbeard/helpers.py b/sickbeard/helpers.py index 83c88602..0cf26f8c 100644 --- a/sickbeard/helpers.py +++ b/sickbeard/helpers.py @@ -264,7 +264,7 @@ def makeDir(path): return True -def searchDBForShow(regShowName, useIndexer=False): +def searchDBForShow(regShowName): showNames = [re.sub('[. -]', ' ', regShowName),regShowName] @@ -274,7 +274,7 @@ def searchDBForShow(regShowName, useIndexer=False): for showName in showNames: - show = get_show_by_name(showName,sickbeard.showList, useIndexer==useIndexer) + show = get_show_by_name(showName, sickbeard.showList) if show: sqlResults = myDB.select("SELECT * FROM tv_shows WHERE show_name LIKE ? OR show_name LIKE ?", [show.name, show.name]) else: diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py index b1df71f8..80696236 100644 --- a/sickbeard/show_name_helpers.py +++ b/sickbeard/show_name_helpers.py @@ -194,7 +194,12 @@ 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,2}[a-zA-Z]{2})[. _-]+([a-zA-Z]{3,})[. _-]+(\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,2}[a-zA-Z]{2})[. _-]+([a-zA-Z]{3,})[. _-]+(\d{4})*(.+?)([. _-])()((([^- ]+))?)?$' if log: logger.log(u"Checking if show " + name + " matches " + curRegex, logger.DEBUG)