diff --git a/comicfn2dict/parse.py b/comicfn2dict/parse.py index 5ed2c23..8f72170 100644 --- a/comicfn2dict/parse.py +++ b/comicfn2dict/parse.py @@ -6,6 +6,7 @@ from re import Pattern from typing import Any from comicfn2dict.regex import ( + NON_NUMBER_DOT_RE, EXTRA_SPACES_RE, ISSUE_ANYWHERE_RE, ISSUE_COUNT_RE, @@ -133,6 +134,8 @@ class ComicFilenameParser: unused_tokens.append(token) continue value = self._grouping_operators_strip(value) + value = NON_NUMBER_DOT_RE.sub(r"\1 \2", value) + self.metadata[key] = value remaining_key_index += 1 else: @@ -165,6 +168,7 @@ class ComicFilenameParser: self._log_progress("INITIAL") self._parse_ext() self._clean_dividers() + self._log_progress("CLEANED") # Parse paren tokens self._parse_item(ISSUE_COUNT_RE) diff --git a/comicfn2dict/regex.py b/comicfn2dict/regex.py index 01bbcbe..296fab9 100644 --- a/comicfn2dict/regex.py +++ b/comicfn2dict/regex.py @@ -73,3 +73,5 @@ ISSUE_ANYWHERE_RE = re_compile(r"\b(" + _ISSUE_RE_EXP + r")\b") # LONG STRINGS REMAINING_GROUP_RE = re_compile(r"^[^\()].*[^\)]") + +NON_NUMBER_DOT_RE = re_compile(r"(\D)\.(\D)") diff --git a/tests/comic_filenames.py b/tests/comic_filenames.py index 4d67eaa..74e04db 100644 --- a/tests/comic_filenames.py +++ b/tests/comic_filenames.py @@ -309,6 +309,11 @@ FNS.update( "series": "Star Wars - War of the Bounty Hunters - IG-88", "year": "2021", }, + "Free Comic Book Day - Avengers.Hulk (2021).cbz": { + "ext": "cbz", + "series": "Free Comic Book Day - Avengers Hulk", + "year": "2021", + }, } ) LATER = { @@ -333,11 +338,6 @@ LATER = { # Not examined yet. FNS.update( { - "Free Comic Book Day - Avengers.Hulk (2021).cbz": { - "ext": "cbz", - "series": "Free Comic Book Day - Avengers Hulk", - "year": "2021", - }, # CT assumes the volume is also the issue number if it can't find an issue number "Avengers By Brian Michael Bendis volume 03 (2013).cbz": { "ext": "cbz",