Fix for new show searches, now checks alias names as well as series names to get results.

This commit is contained in:
echel0n 2014-05-26 00:45:11 -07:00
parent 9a3e7ab0a9
commit 7a56afe512
1 changed files with 12 additions and 2 deletions

View File

@ -151,6 +151,8 @@ class AllShowsListUI:
def selectSeries(self, allSeries):
searchResults = []
seriesnames = []
# get all available shows
if allSeries:
if 'searchterm' in self.config:
@ -159,14 +161,22 @@ class AllShowsListUI:
for curShow in allSeries:
if curShow in searchResults:
continue
if 'seriesname' in curShow:
if searchterm.lower() in curShow['seriesname'].lower():
seriesnames.append(str(curShow['seriesname']))
if 'aliasnames' in curShow:
seriesnames.extend(str(curShow['aliasnames']).split('|'))
for name in seriesnames:
if searchterm.lower() in name.lower():
if 'firstaired' not in curShow:
curShow['firstaired'] = str(datetime.date.fromordinal(1))
curShow['firstaired'] = re.sub("([-]0{2}){1,}", "", curShow['firstaired'])
fixDate = parser.parse(curShow['firstaired'], fuzzy=True).date()
curShow['firstaired'] = fixDate.strftime("%Y-%m-%d")
searchResults.append(curShow)
if curShow not in searchResults:
searchResults += [curShow]
return searchResults