From da373764e091e0880807414276a0358eddf63b61 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sun, 17 Dec 2023 21:37:12 -0800 Subject: [PATCH] Let the original ComicRack metadata be disabled Ensure metadata styles can be overridden by other plugins --- comictaggerlib/ctsettings/file.py | 6 ++++++ comictaggerlib/ctsettings/settngs_namespace.py | 1 + comictaggerlib/main.py | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/comictaggerlib/ctsettings/file.py b/comictaggerlib/ctsettings/file.py index 9bee2a3..8102a8c 100644 --- a/comictaggerlib/ctsettings/file.py +++ b/comictaggerlib/ctsettings/file.py @@ -12,6 +12,12 @@ from comictaggerlib.defaults import DEFAULT_REPLACEMENTS, Replacement, Replaceme def general(parser: settngs.Manager) -> None: # General Settings parser.add_setting("check_for_new_version", default=False, cmdline=False) + parser.add_setting( + "--disable-cr", + default=False, + action=argparse.BooleanOptionalAction, + help="Disable the ComicRack metadata type", + ) def internal(parser: settngs.Manager) -> None: diff --git a/comictaggerlib/ctsettings/settngs_namespace.py b/comictaggerlib/ctsettings/settngs_namespace.py index 1f1c156..14d115a 100644 --- a/comictaggerlib/ctsettings/settngs_namespace.py +++ b/comictaggerlib/ctsettings/settngs_namespace.py @@ -96,6 +96,7 @@ class settngs_namespace(settngs.TypedNS): Auto_Tag__remove_archive_after_successful_match: bool General__check_for_new_version: bool + General__disable_cr: bool Dialog_Flags__show_disclaimer: bool Dialog_Flags__dont_notify_about_this_version: str diff --git a/comictaggerlib/main.py b/comictaggerlib/main.py index 6e4c2d6..9b34078 100644 --- a/comictaggerlib/main.py +++ b/comictaggerlib/main.py @@ -223,6 +223,10 @@ class App: # config already loaded error = None + if self.config[0].General__disable_cr: + if "cr" in comicapi.comicarchive.metadata_styles: + del comicapi.comicarchive.metadata_styles["cr"] + if len(self.talkers) < 1: error = error = ( "Failed to load any talkers, please re-install and check the log located in '"