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

Accuracey and speed improved for nameparser.

This commit is contained in:
echel0n 2014-07-19 05:06:18 -07:00
parent c25da850ab
commit eff064f347

View File

@ -142,6 +142,16 @@ class NameParser(object):
result.score += 1
elif result.show:
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:
result.score += 1
elif regexMode == self.ANIME_REGEX and result.show.is_anime:
result.score += 1
else:
break
if 'season_num' in named_groups:
tmp_season = int(match.group('season_num'))
if not (cur_regex_name == 'bare' and tmp_season in (19, 20)):
@ -214,14 +224,6 @@ class NameParser(object):
result.release_group = match.group('release_group')
result.score += 1
if result.show:
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:
result.score += 1
elif regexMode == self.ANIME_REGEX and result.show.is_anime:
result.score += 1
matches.append(result)
time.sleep(0.02)