mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Fixed name parsing result issues with improper regex patterns being used.
This commit is contained in:
parent
579681386e
commit
c4a0f314fd
@ -29,6 +29,7 @@ import sickbeard
|
|||||||
from sickbeard import logger, helpers, scene_numbering, common, exceptions, scene_exceptions
|
from sickbeard import logger, helpers, scene_numbering, common, exceptions, scene_exceptions
|
||||||
from dateutil import parser
|
from dateutil import parser
|
||||||
|
|
||||||
|
|
||||||
class NameParser(object):
|
class NameParser(object):
|
||||||
NORMAL_REGEX = 0
|
NORMAL_REGEX = 0
|
||||||
SPORTS_REGEX = 1
|
SPORTS_REGEX = 1
|
||||||
@ -216,7 +217,13 @@ class NameParser(object):
|
|||||||
result.release_group = match.group('release_group')
|
result.release_group = match.group('release_group')
|
||||||
result.score += 1
|
result.score += 1
|
||||||
|
|
||||||
doneSearch = True if result.show else False
|
if result.show:
|
||||||
|
if regexMode == self.NORMAL_REGEX and not (result.show.is_anime or result.show.is_sports):
|
||||||
|
doneSearch = True
|
||||||
|
elif regexMode == self.SPORTS_REGEX and result.show.is_sports:
|
||||||
|
doneSearch = True
|
||||||
|
elif regexMode == self.ANIME_REGEX and result.show.is_anime:
|
||||||
|
doneSearch = True
|
||||||
|
|
||||||
matches.append(result)
|
matches.append(result)
|
||||||
|
|
||||||
@ -599,6 +606,7 @@ class ParseResult(object):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
class NameParserCache(object):
|
class NameParserCache(object):
|
||||||
_previous_parsed = {}
|
_previous_parsed = {}
|
||||||
_cache_size = 100
|
_cache_size = 100
|
||||||
|
Loading…
Reference in New Issue
Block a user