From c4a0f314fdfe5b750c0d8314cf9912b8688e43ef Mon Sep 17 00:00:00 2001 From: echel0n Date: Fri, 18 Jul 2014 11:47:19 -0700 Subject: [PATCH] Fixed name parsing result issues with improper regex patterns being used. --- sickbeard/name_parser/parser.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sickbeard/name_parser/parser.py b/sickbeard/name_parser/parser.py index b594fff9..38b41f11 100644 --- a/sickbeard/name_parser/parser.py +++ b/sickbeard/name_parser/parser.py @@ -29,6 +29,7 @@ import sickbeard from sickbeard import logger, helpers, scene_numbering, common, exceptions, scene_exceptions from dateutil import parser + class NameParser(object): NORMAL_REGEX = 0 SPORTS_REGEX = 1 @@ -216,7 +217,13 @@ class NameParser(object): result.release_group = match.group('release_group') 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) @@ -599,6 +606,7 @@ class ParseResult(object): return True return False + class NameParserCache(object): _previous_parsed = {} _cache_size = 100