From 05cca0dfe02e6415e1349ba4b30a44be1f630ea0 Mon Sep 17 00:00:00 2001 From: echel0n Date: Fri, 30 May 2014 01:16:12 -0700 Subject: [PATCH] Fixed post-processing issues with shows being rejected and saying they didn't exist when infact they did. Fixed a issue in our name parser code that would of resulted in searches failing completely. --- sickbeard/name_parser/parser.py | 11 ++++++++--- sickbeard/postProcessor.py | 7 +++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index 8c15f8f6..cd36951a 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -137,13 +137,18 @@ class NameParser(object): result.series_name = self.clean_series_name(result.series_name) cur_show = helpers.get_show_by_name(result.series_name, useIndexer=self.useIndexers) - if self.show and cur_show: + if not cur_show: + continue + + # if we have a show object to compare against then do so else return the result anyways + if self.show: if self.show.indexerid != cur_show.indexerid: logger.log( u"I expected an episode of the show " + self.show.name + " but the parser thinks its the show " + cur_show.name + ". I will continue thinking its " + self.show.name, logger.WARNING) - else: - result.show = self.show + continue + + result.show = cur_show if 'season_num' in named_groups: tmp_season = int(match.group('season_num')) diff --git a/sickbeard/postProcessor.py b/sickbeard/postProcessor.py index 6763272d..6cb4fa05 100644 --- a/sickbeard/postProcessor.py +++ b/sickbeard/postProcessor.py @@ -416,6 +416,9 @@ class PostProcessor(object): continue show = helpers.findCertainShow(sickbeard.showList, int(sql_results[0]["showid"])) + if not show: + continue + season = int(sql_results[0]["season"]) quality = int(sql_results[0]["quality"]) @@ -481,6 +484,10 @@ class PostProcessor(object): self._log(u"Parsed " + name + " into " + str(parse_result).decode('utf-8', 'xmlcharrefreplace'), logger.DEBUG) + # couldn't find this in our show list + if not parse_result.show: + return to_return + if parse_result.air_by_date: season = -1 episodes = [parse_result.air_date]