Fix filename parsing not respecting user settings

This commit is contained in:
Timmy Welch 2023-12-25 21:57:31 -08:00
parent 230a4b6558
commit db00736f58
5 changed files with 17 additions and 17 deletions

View File

@ -254,7 +254,9 @@ class CLI:
self.config.Filename_Parsing__remove_c2c,
self.config.Filename_Parsing__remove_fcbd,
self.config.Filename_Parsing__remove_publisher,
self.config.Runtime_Options__split_words,
self.config.Filename_Parsing__split_words,
self.config.Filename_Parsing__allow_issue_start_with_letter,
self.config.Filename_Parsing__protofolius_issue_number_scheme,
)
md.overlay(f_md)

View File

@ -145,12 +145,6 @@ def register_runtime(parser: settngs.Manager) -> None:
help="Recursively include files in sub-folders.",
file=False,
)
parser.add_setting(
"--split-words",
action="store_true",
help="""Splits words before parsing the filename.\ne.g. 'judgedredd' to 'judge dredd'\n\n""",
file=False,
)
parser.add_setting(
"-n",
"--dryrun",

View File

@ -119,6 +119,12 @@ def filename(parser: settngs.Manager) -> None:
action=argparse.BooleanOptionalAction,
help="Attempts to remove publisher names from filenames, currently limited to Marvel and DC. Requires --complicated-parser",
)
parser.add_setting(
"--split-words",
action="store_true",
help="""Splits words before parsing the filename.\ne.g. 'judgedredd' to 'judge dredd'\n\n""",
file=False,
)
parser.add_setting(
"--protofolius-issue-number-scheme",
default=False,

View File

@ -26,7 +26,6 @@ class settngs_namespace(settngs.TypedNS):
Runtime_Options__summary: bool
Runtime_Options__raw: bool
Runtime_Options__recursive: bool
Runtime_Options__split_words: bool
Runtime_Options__dryrun: bool
Runtime_Options__darkmode: bool
Runtime_Options__glob: bool
@ -64,6 +63,7 @@ class settngs_namespace(settngs.TypedNS):
Filename_Parsing__remove_c2c: bool
Filename_Parsing__remove_fcbd: bool
Filename_Parsing__remove_publisher: bool
Filename_Parsing__split_words: bool
Filename_Parsing__protofolius_issue_number_scheme: bool
Filename_Parsing__allow_issue_start_with_letter: bool

View File

@ -682,12 +682,7 @@ class TaggerWindow(QtWidgets.QMainWindow):
def update_ui_for_archive(self, parse_filename: bool = True) -> None:
if self.comic_archive is not None:
if self.metadata.is_empty and parse_filename:
self.metadata = self.comic_archive.metadata_from_filename(
self.config[0].Filename_Parsing__complicated_parser,
self.config[0].Filename_Parsing__remove_c2c,
self.config[0].Filename_Parsing__remove_fcbd,
self.config[0].Filename_Parsing__remove_publisher,
)
self.use_filename()
self.metadata.apply_default_page_list(self.comic_archive.get_page_name_list())
@ -1012,10 +1007,11 @@ class TaggerWindow(QtWidgets.QMainWindow):
self.config[0].Filename_Parsing__remove_fcbd,
self.config[0].Filename_Parsing__remove_publisher,
split_words,
self.config[0].Filename_Parsing__allow_issue_start_with_letter,
self.config[0].Filename_Parsing__protofolius_issue_number_scheme,
)
if new_metadata is not None:
self.metadata.overlay(new_metadata)
self.metadata_to_form()
self.metadata.overlay(new_metadata)
self.metadata_to_form()
def use_filename_split(self) -> None:
self._use_filename(True)
@ -1666,6 +1662,8 @@ class TaggerWindow(QtWidgets.QMainWindow):
self.config[0].Filename_Parsing__remove_fcbd,
self.config[0].Filename_Parsing__remove_publisher,
dlg.split_words,
self.config[0].Filename_Parsing__allow_issue_start_with_letter,
self.config[0].Filename_Parsing__protofolius_issue_number_scheme,
)
if dlg.ignore_leading_digits_in_filename and md.series is not None:
# remove all leading numbers