Fixed a bug that was majorly slowing down the performance of SB, was causing SB to search for indexer id number from RSS cache results as they came in so basically searching shows that most probally didnt even have indexed.

This commit is contained in:
echel0n 2014-03-17 08:57:57 -07:00
parent 02ef367583
commit 5c0af16297
2 changed files with 8 additions and 3 deletions

View File

@ -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:

View File

@ -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)