From 7a56afe512f001509ca9d61f0ccedb230980dee7 Mon Sep 17 00:00:00 2001 From: echel0n Date: Mon, 26 May 2014 00:45:11 -0700 Subject: [PATCH] Fix for new show searches, now checks alias names as well as series names to get results. --- sickbeard/classes.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sickbeard/classes.py b/sickbeard/classes.py index 75169e05..e60074bb 100644 --- a/sickbeard/classes.py +++ b/sickbeard/classes.py @@ -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