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:
parent
c25da850ab
commit
eff064f347
@ -142,6 +142,16 @@ class NameParser(object):
|
|||||||
|
|
||||||
result.score += 1
|
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:
|
if 'season_num' in named_groups:
|
||||||
tmp_season = int(match.group('season_num'))
|
tmp_season = int(match.group('season_num'))
|
||||||
if not (cur_regex_name == 'bare' and tmp_season in (19, 20)):
|
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.release_group = match.group('release_group')
|
||||||
result.score += 1
|
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)
|
matches.append(result)
|
||||||
|
|
||||||
time.sleep(0.02)
|
time.sleep(0.02)
|
||||||
|
Loading…
Reference in New Issue
Block a user