mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-05 17:43:37 +00:00
Accuracey and speed improved for nameparser.
This commit is contained in:
parent
c25da850ab
commit
eff064f347
1 changed files with 10 additions and 8 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue