move function

This commit is contained in:
AJ Slater 2024-02-23 17:39:02 -08:00
parent 551804ad50
commit 7d98a8cea6

View File

@ -47,7 +47,7 @@ class ComicFilenameParser:
return -1 return -1
if value not in self._path_indexes: if value not in self._path_indexes:
# TODO This is fragile. # TODO This is fragile.
# Better to get it at match time. # Can I get it at match time?
if key == "ext": if key == "ext":
index = self.path.rfind(value) index = self.path.rfind(value)
else: else:
@ -67,15 +67,6 @@ class ComicFilenameParser:
self.metadata["ext"] = ext self.metadata["ext"] = ext
self._unparsed_path = data self._unparsed_path = data
def _grouping_operators_strip(self, value: str) -> str:
"""Strip spaces and parens."""
value = value.strip()
value = value.strip("()").strip()
value = value.strip("-").strip()
value = value.strip(",").strip()
value = value.strip("'").strip()
return value.strip('"').strip()
def _clean_dividers(self): def _clean_dividers(self):
"""Replace non space dividers and clean extra spaces out of string.""" """Replace non space dividers and clean extra spaces out of string."""
data = self._unparsed_path data = self._unparsed_path
@ -174,6 +165,15 @@ class ComicFilenameParser:
break break
return title_ok or not other_tokens_exist return title_ok or not other_tokens_exist
def _grouping_operators_strip(self, value: str) -> str:
"""Strip spaces and parens."""
value = value.strip()
value = value.strip("()").strip()
value = value.strip("-").strip()
value = value.strip(",").strip()
value = value.strip("'").strip()
return value.strip('"').strip()
def _assign_remaining_groups(self): def _assign_remaining_groups(self):
"""Assign series and title.""" """Assign series and title."""
if not self._unparsed_path: if not self._unparsed_path: