1
0
mirror of https://github.com/moparisthebest/SickRage synced 2024-12-12 11:02:21 -05:00

Updated code to perform indexer id comparisons to confirm show is correctly choosen if we passed in a show object to test against.

This commit is contained in:
echel0n 2014-07-19 06:09:16 -07:00
parent 222f702f46
commit bf40e6bd98

View File

@ -130,11 +130,17 @@ class NameParser(object):
result.series_name = self.clean_series_name(result.series_name) result.series_name = self.clean_series_name(result.series_name)
result.score += 1 result.score += 1
# confirm show object # get show object
if result.show: if not result.show and not self.naming_pattern:
if self.showObj and self.showObj.name.lower() == result.show.name.lower(): result.show = helpers.get_show(result.series_name, indexer_id=self.showObj.indexerid)
continue
# 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): if regexMode == self.NORMAL_REGEX and not (result.show.is_anime or result.show.is_sports):
result.score += 1 result.score += 1
elif regexMode == self.SPORTS_REGEX and result.show.is_sports: elif regexMode == self.SPORTS_REGEX and result.show.is_sports:
@ -143,11 +149,6 @@ class NameParser(object):
result.score += 1 result.score += 1
else: else:
break 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: if 'season_num' in named_groups:
tmp_season = int(match.group('season_num')) tmp_season = int(match.group('season_num'))