From a552f05b2367bf208806a2b24d51e364504c8ada Mon Sep 17 00:00:00 2001 From: Mizaki Date: Sat, 1 Jun 2024 19:40:13 +0100 Subject: [PATCH] Add remove HTML tables back --- comictaggerlib/ctsettings/file.py | 15 ++++++++------- comictaggerlib/ctsettings/settngs_namespace.py | 2 +- comictaggerlib/settingswindow.py | 3 ++- comictaggerlib/ui/settingswindow.ui | 7 +++++++ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/comictaggerlib/ctsettings/file.py b/comictaggerlib/ctsettings/file.py index b952cd2..7999bdb 100644 --- a/comictaggerlib/ctsettings/file.py +++ b/comictaggerlib/ctsettings/file.py @@ -151,13 +151,6 @@ def talker(parser: settngs.Manager) -> None: default="comicvine", help="Use a specified source by source ID (use --list-plugins to list all sources)", ) - parser.add_setting( - "--remove-html-tables", - default=False, - action=argparse.BooleanOptionalAction, - display_name="Remove HTML tables", - help="Removes html tables instead of converting them to text", - ) def md_options(parser: settngs.Manager) -> None: @@ -172,6 +165,14 @@ def md_options(parser: settngs.Manager) -> None: parser.add_setting("--cbl-apply-transform-on-import", default=False, action=argparse.BooleanOptionalAction) parser.add_setting("--cbl-apply-transform-on-bulk-operation", default=False, action=argparse.BooleanOptionalAction) + parser.add_setting( + "--remove-html-tables", + default=False, + action=argparse.BooleanOptionalAction, + display_name="Remove HTML tables", + help="Removes html tables instead of converting them to text", + ) + parser.add_setting("use_short_metadata_names", default=False, action=argparse.BooleanOptionalAction, cmdline=False) parser.add_setting( "--disable-cr", diff --git a/comictaggerlib/ctsettings/settngs_namespace.py b/comictaggerlib/ctsettings/settngs_namespace.py index fcfd4f2..8f0c653 100644 --- a/comictaggerlib/ctsettings/settngs_namespace.py +++ b/comictaggerlib/ctsettings/settngs_namespace.py @@ -79,7 +79,6 @@ class SettngsNS(settngs.TypedNS): Filename_Parsing__allow_issue_start_with_letter: bool Sources__source: str - Sources__remove_html_tables: bool Metadata_Options__cbl_assume_lone_credit_is_primary: bool Metadata_Options__cbl_copy_characters_to_tags: bool @@ -92,6 +91,7 @@ class SettngsNS(settngs.TypedNS): Metadata_Options__cbl_apply_transform_on_bulk_operation: bool Metadata_Options__use_short_metadata_names: bool Metadata_Options__disable_cr: bool + Metadata_Options__remove_html_tables: bool File_Rename__template: str File_Rename__issue_number_padding: int diff --git a/comictaggerlib/settingswindow.py b/comictaggerlib/settingswindow.py index 2e5d621..f14e87d 100644 --- a/comictaggerlib/settingswindow.py +++ b/comictaggerlib/settingswindow.py @@ -430,6 +430,7 @@ class SettingsWindow(QtWidgets.QDialog): self.cbxApplyCBLTransformOnBatchOperation.setChecked( self.config[0].Metadata_Options__cbl_apply_transform_on_bulk_operation ) + self.cbxRemoveHtmlTables.setChecked(self.config[0].Metadata_Options__remove_html_tables) self.cbxOverlayReadStyle.setCurrentIndex( self.cbxOverlayReadStyle.findData(self.config[0].internal__load_data_overlay.value) ) @@ -561,7 +562,7 @@ class SettingsWindow(QtWidgets.QDialog): self.config.values.Metadata_Options__cbl_apply_transform_on_bulk_operation = ( self.cbxApplyCBLTransformOnBatchOperation.isChecked() ) - + self.config[0].Metadata_Options__remove_html_tables = self.cbxRemoveHtmlTables.isChecked() self.config[0].internal__load_data_overlay = merge.Mode[self.cbxOverlayReadStyle.currentData().upper()] self.config[0].internal__source_data_overlay = merge.Mode[self.cbxOverlaySource.currentData().upper()] self.config[0].internal__overlay_merge_lists = self.cbxOverlayMergeLists.isChecked() diff --git a/comictaggerlib/ui/settingswindow.ui b/comictaggerlib/ui/settingswindow.ui index 1a9a2af..2549b92 100644 --- a/comictaggerlib/ui/settingswindow.ui +++ b/comictaggerlib/ui/settingswindow.ui @@ -481,6 +481,13 @@ + + + + Remove HTML tables from descriptions + + +