Fix parsing show names that contain the word "parts" by making parser more restrictive.

This commit is contained in:
Prinz23 2024-06-23 19:29:42 +02:00 committed by JackDandy
parent c5e9317929
commit d1d06ba914
3 changed files with 9 additions and 2 deletions

View file

@ -1,4 +1,9 @@
### 3.31.1 (2024-06-14 01:00:00 UTC) ### 3.31.2 (2024-06-23 18:20:00 UTC)
* Fix parsing show names that contain the word "parts" by making parser more restrictive
### 3.31.1 (2024-06-14 01:00:00 UTC)
* Change allow Python 3.12.4 * Change allow Python 3.12.4

View file

@ -170,7 +170,7 @@ class NameParser(object):
result.series_name = match.group('series_name') result.series_name = match.group('series_name')
if result.series_name: if result.series_name:
result.series_name = self.clean_series_name(result.series_name) result.series_name = self.clean_series_name(result.series_name)
name_parts = re.match(r'(?i)(.*)[ -]((?:part|pt)[ -]?\w+)$', result.series_name) name_parts = re.match(r'(?i)(.*)[ -]((?:part|pt)[ -]?[0-9IVXL]+)$', result.series_name)
try: try:
result.series_name = name_parts.group(1) result.series_name = name_parts.group(1)
result.extra_info = name_parts.group(2) result.extra_info = name_parts.group(2)

View file

@ -44,6 +44,8 @@ simple_test_cases = {
'Show.Name.S01E15-11001001': parser.ParseResult(None, 'Show Name', 1, [15], None), 'Show.Name.S01E15-11001001': parser.ParseResult(None, 'Show Name', 1, [15], None),
'Show.Name.S01E02.Source.Quality.Etc-Group - [stuff]': 'Show.Name.S01E02.Source.Quality.Etc-Group - [stuff]':
parser.ParseResult(None, 'Show Name', 1, [2], 'Source.Quality.Etc', 'Group'), parser.ParseResult(None, 'Show Name', 1, [2], 'Source.Quality.Etc', 'Group'),
'Show.Name.Parts.S02E01':
parser.ParseResult(None, 'Show Name Parts', 2, [1]),
}, },
'non_standard_multi_ep': { 'non_standard_multi_ep': {