From bf40e6bd98c64ee26eba2741eee3cd13900ebd86 Mon Sep 17 00:00:00 2001 From: echel0n Date: Sat, 19 Jul 2014 06:09:16 -0700 Subject: [PATCH] Updated code to perform indexer id comparisons to confirm show is correctly choosen if we passed in a show object to test against. --- sickbeard/name_parser/parser.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index bdb83d13..6739fcf8 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -130,11 +130,17 @@ class NameParser(object): result.series_name = self.clean_series_name(result.series_name) result.score += 1 - # confirm show object - if result.show: - if self.showObj and self.showObj.name.lower() == result.show.name.lower(): - continue + # get show object + if not result.show and not self.naming_pattern: + result.show = helpers.get_show(result.series_name, indexer_id=self.showObj.indexerid) + # confirm result show object variables + if result.show: + # confirm passed in show object indexer id matches result show object indexer id + if self.showObj and self.showObj.indexerid != result.show.indexerid: + break + + # confirm we are using correct regex mode if regexMode == self.NORMAL_REGEX and not (result.show.is_anime or result.show.is_sports): result.score += 1 elif regexMode == self.SPORTS_REGEX and result.show.is_sports: @@ -143,11 +149,6 @@ class NameParser(object): result.score += 1 else: break - else: - if not self.naming_pattern: - result.show = helpers.get_show_by_name(result.series_name, useIndexer=self.useIndexers) - if not result.show: - continue if 'season_num' in named_groups: tmp_season = int(match.group('season_num'))