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

View file

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