Re-arrange settings
This commit is contained in:
parent
af9c8afad7
commit
e864e2db48
@ -46,11 +46,11 @@ class AutoTagStartWindow(QtWidgets.QDialog):
|
||||
self.leSearchString.setEnabled(False)
|
||||
|
||||
self.cbxSaveOnLowConfidence.setChecked(self.config.Auto_Tag__save_on_low_confidence)
|
||||
self.cbxDontUseYear.setChecked(self.config.Auto_Tag__dont_use_year_when_identifying)
|
||||
self.cbxDontUseYear.setChecked(self.config.Auto_Tag__dont_use_year_when_auto_tagging)
|
||||
self.cbxAssumeIssueOne.setChecked(self.config.Auto_Tag__assume_issue_one)
|
||||
self.cbxIgnoreLeadingDigitsInFilename.setChecked(self.config.Auto_Tag__ignore_leading_numbers_in_filename)
|
||||
self.cbxRemoveAfterSuccess.setChecked(self.config.Auto_Tag__remove_archive_after_successful_match)
|
||||
self.cbxAutoImprint.setChecked(self.config.Issue_Identifier__auto_imprint)
|
||||
self.cbxAutoImprint.setChecked(self.config.Auto_Tag__auto_imprint)
|
||||
|
||||
nlmt_tip = """<html>The <b>Name Match Ratio Threshold: Auto-Identify</b> is for eliminating automatic
|
||||
search matches that are too long compared to your series name search. The lower
|
||||
@ -95,7 +95,7 @@ class AutoTagStartWindow(QtWidgets.QDialog):
|
||||
|
||||
# persist some settings
|
||||
self.config.Auto_Tag__save_on_low_confidence = self.auto_save_on_low
|
||||
self.config.Auto_Tag__dont_use_year_when_identifying = self.dont_use_year
|
||||
self.config.Auto_Tag__dont_use_year_when_auto_tagging = self.dont_use_year
|
||||
self.config.Auto_Tag__assume_issue_one = self.assume_issue_one
|
||||
self.config.Auto_Tag__ignore_leading_numbers_in_filename = self.ignore_leading_digits_in_filename
|
||||
self.config.Auto_Tag__remove_archive_after_successful_match = self.remove_after_success
|
||||
|
@ -30,7 +30,7 @@ class CBLTransformer:
|
||||
self.config = config
|
||||
|
||||
def apply(self) -> GenericMetadata:
|
||||
if self.config.Metadata_Options__cbl_assume_lone_credit_is_primary:
|
||||
if self.config.Metadata_Options__assume_lone_credit_is_primary:
|
||||
# helper
|
||||
def set_lone_primary(role_list: list[str]) -> tuple[Credit | None, int]:
|
||||
lone_credit: Credit | None = None
|
||||
@ -56,19 +56,19 @@ class CBLTransformer:
|
||||
c.primary = False
|
||||
self.metadata.add_credit(c.person, "Artist", True)
|
||||
|
||||
if self.config.Metadata_Options__cbl_copy_characters_to_tags:
|
||||
if self.config.Metadata_Options__copy_characters_to_tags:
|
||||
self.metadata.tags.update(x for x in self.metadata.characters)
|
||||
|
||||
if self.config.Metadata_Options__cbl_copy_teams_to_tags:
|
||||
if self.config.Metadata_Options__copy_teams_to_tags:
|
||||
self.metadata.tags.update(x for x in self.metadata.teams)
|
||||
|
||||
if self.config.Metadata_Options__cbl_copy_locations_to_tags:
|
||||
if self.config.Metadata_Options__copy_locations_to_tags:
|
||||
self.metadata.tags.update(x for x in self.metadata.locations)
|
||||
|
||||
if self.config.Metadata_Options__cbl_copy_storyarcs_to_tags:
|
||||
if self.config.Metadata_Options__copy_storyarcs_to_tags:
|
||||
self.metadata.tags.update(x for x in self.metadata.story_arcs)
|
||||
|
||||
if self.config.Metadata_Options__cbl_copy_notes_to_comments:
|
||||
if self.config.Metadata_Options__copy_notes_to_comments:
|
||||
if self.metadata.notes is not None:
|
||||
if self.metadata.description is None:
|
||||
self.metadata.description = ""
|
||||
@ -77,7 +77,7 @@ class CBLTransformer:
|
||||
if self.metadata.notes not in self.metadata.description:
|
||||
self.metadata.description += self.metadata.notes
|
||||
|
||||
if self.config.Metadata_Options__cbl_copy_weblink_to_comments:
|
||||
if self.config.Metadata_Options__copy_weblink_to_comments:
|
||||
for web_link in self.metadata.web_links:
|
||||
temp_desc = self.metadata.description
|
||||
if temp_desc is None:
|
||||
|
@ -113,7 +113,7 @@ class CLI:
|
||||
|
||||
self.post_process_matches(match_results)
|
||||
|
||||
if self.config.Runtime_Options__online:
|
||||
if self.config.Auto_Tag__online:
|
||||
self.output(
|
||||
f"\nFiles tagged with metadata provided by {self.current_talker().name} {self.current_talker().website}",
|
||||
)
|
||||
@ -127,7 +127,7 @@ class CLI:
|
||||
logger.exception(f"Error retrieving issue details. Save aborted.\n{e}")
|
||||
return GenericMetadata()
|
||||
|
||||
if self.config.Metadata_Options__cbl_apply_transform_on_import:
|
||||
if self.config.Metadata_Options__apply_transform_on_import:
|
||||
ct_md = CBLTransformer(ct_md, self.config).apply()
|
||||
|
||||
return ct_md
|
||||
@ -236,7 +236,7 @@ class CLI:
|
||||
md.apply_default_page_list(ca.get_page_name_list())
|
||||
|
||||
# now, overlay the parsed filename info
|
||||
if self.config.Runtime_Options__parse_filename:
|
||||
if self.config.Auto_Tag__parse_filename:
|
||||
f_md = ca.metadata_from_filename(
|
||||
self.config.Filename_Parsing__filename_parser,
|
||||
self.config.Filename_Parsing__remove_c2c,
|
||||
@ -259,7 +259,7 @@ class CLI:
|
||||
logger.error("Failed to load metadata for %s: %s", ca.path, e)
|
||||
|
||||
# finally, use explicit stuff (always 'overlay' mode)
|
||||
md.overlay(self.config.Runtime_Options__metadata, mode=merge.Mode.OVERLAY, merge_lists=True)
|
||||
md.overlay(self.config.Auto_Tag__metadata, mode=merge.Mode.OVERLAY, merge_lists=True)
|
||||
|
||||
return md
|
||||
|
||||
@ -332,7 +332,7 @@ class CLI:
|
||||
|
||||
def copy_style(self, ca: ComicArchive, md: GenericMetadata, style: str) -> Status:
|
||||
dst_style_name = md_styles[style].name()
|
||||
if not self.config.Runtime_Options__overwrite and ca.has_metadata(style):
|
||||
if not self.config.Runtime_Options__skip_existing_metadata and ca.has_metadata(style):
|
||||
self.output(f"{ca.path}: Already has {dst_style_name} tags. Not overwriting.")
|
||||
return Status.existing_tags
|
||||
if self.config.Commands__copy == style:
|
||||
@ -341,7 +341,7 @@ class CLI:
|
||||
|
||||
src_style_name = md_styles[self.config.Commands__copy].name()
|
||||
if not self.config.Runtime_Options__dryrun:
|
||||
if self.config.Metadata_Options__cbl_apply_transform_on_bulk_operation == "cbi":
|
||||
if self.config.Metadata_Options__apply_transform_on_bulk_operation and style == "cbi":
|
||||
md = CBLTransformer(md, self.config).apply()
|
||||
|
||||
if ca.write_metadata(md, style):
|
||||
@ -378,7 +378,7 @@ class CLI:
|
||||
return res
|
||||
|
||||
def save(self, ca: ComicArchive, match_results: OnlineMatchResults) -> tuple[Result, OnlineMatchResults]:
|
||||
if not self.config.Runtime_Options__overwrite:
|
||||
if not self.config.Runtime_Options__skip_existing_metadata:
|
||||
for style in self.config.Runtime_Options__type_modify:
|
||||
if ca.has_metadata(style):
|
||||
self.output(f"{ca.path}: Already has {md_styles[style].name()} tags. Not overwriting.")
|
||||
@ -404,11 +404,11 @@ class CLI:
|
||||
# now, search online
|
||||
|
||||
ct_md = GenericMetadata()
|
||||
if self.config.Runtime_Options__online:
|
||||
if self.config.Runtime_Options__issue_id is not None:
|
||||
if self.config.Auto_Tag__online:
|
||||
if self.config.Auto_Tag__issue_id is not None:
|
||||
# we were given the actual issue ID to search with
|
||||
try:
|
||||
ct_md = self.current_talker().fetch_comic_data(self.config.Runtime_Options__issue_id)
|
||||
ct_md = self.current_talker().fetch_comic_data(self.config.Auto_Tag__issue_id)
|
||||
except TalkerError as e:
|
||||
logger.exception(f"Error retrieving issue details. Save aborted.\n{e}")
|
||||
res = Result(
|
||||
@ -421,7 +421,7 @@ class CLI:
|
||||
return res, match_results
|
||||
|
||||
if ct_md is None or ct_md.is_empty:
|
||||
logger.error("No match for ID %s was found.", self.config.Runtime_Options__issue_id)
|
||||
logger.error("No match for ID %s was found.", self.config.Auto_Tag__issue_id)
|
||||
res = Result(
|
||||
Action.save,
|
||||
status=Status.match_failure,
|
||||
@ -576,7 +576,7 @@ class CLI:
|
||||
|
||||
renamer = FileRenamer(
|
||||
None,
|
||||
platform="universal" if self.config.File_Rename__strict else "auto",
|
||||
platform="universal" if self.config.File_Rename__strict_filenames else "auto",
|
||||
replacements=self.config.File_Rename__replacements,
|
||||
)
|
||||
renamer.set_metadata(md, ca.path.name)
|
||||
|
@ -27,15 +27,9 @@ import settngs
|
||||
|
||||
from comicapi import merge, utils
|
||||
from comicapi.comicarchive import metadata_styles
|
||||
from comicapi.genericmetadata import GenericMetadata
|
||||
from comictaggerlib import ctversion
|
||||
from comictaggerlib.ctsettings.settngs_namespace import SettngsNS as ct_ns
|
||||
from comictaggerlib.ctsettings.types import (
|
||||
ComicTaggerPaths,
|
||||
metadata_type,
|
||||
metadata_type_single,
|
||||
parse_metadata_from_string,
|
||||
)
|
||||
from comictaggerlib.ctsettings.types import ComicTaggerPaths, metadata_type, metadata_type_single
|
||||
from comictaggerlib.resulttypes import Action
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@ -76,54 +70,18 @@ def register_runtime(parser: settngs.Manager) -> None:
|
||||
help="Be noisy when doing what it does. Use a second time to enable debug logs.\nShort option cannot be combined with other options.",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting("--quiet", "-q", action="store_true", help="Don't say much (for print mode).", file=False)
|
||||
parser.add_setting("-q", "--quiet", action="store_true", help="Don't say much (for print mode).", file=False)
|
||||
parser.add_setting(
|
||||
"--json",
|
||||
"-j",
|
||||
"--json",
|
||||
action="store_true",
|
||||
help="Output json on stdout. Ignored in interactive mode.\n\n",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--abort-on-conflict",
|
||||
"--raw",
|
||||
action="store_true",
|
||||
help="""Don't export to zip if intended new filename exists\n(otherwise, creates a new unique filename).\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--delete-original",
|
||||
action="store_true",
|
||||
help="""Delete original archive after successful export to Zip.\n(only relevant for -e)""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"-f",
|
||||
"--parse-filename",
|
||||
"--parsefilename",
|
||||
action="store_true",
|
||||
help="""Parse the filename to get some info,\nspecifically series name, issue number,\nvolume, and publication year.\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--id",
|
||||
dest="issue_id",
|
||||
type=str,
|
||||
help="""Use the issue ID when searching online.\nOverrides all other metadata.\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"-o",
|
||||
"--online",
|
||||
action="store_true",
|
||||
help="""Search online and attempt to identify file\nusing existing metadata and images in archive.\nMay be used in conjunction with -f and -m.\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"-m",
|
||||
"--metadata",
|
||||
default=GenericMetadata(),
|
||||
type=parse_metadata_from_string,
|
||||
help="""Explicitly define some tags to be used in YAML syntax. Use @file.yaml to read from a file. e.g.:\n"series: Plastic Man, publisher: Quality Comics, year: "\n"series: 'Kickers, Inc.', issue: '1', year: 1986"\nIf you want to erase a tag leave the value blank.\nSome names that can be used: series, issue, issue_count, year,\npublisher, title\n\n""",
|
||||
help="""With -p, will print out the raw tag block(s) from the file.""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
@ -138,27 +96,7 @@ def register_runtime(parser: settngs.Manager) -> None:
|
||||
dest="abort_on_low_confidence",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=True,
|
||||
help="""Abort save operation when online match is of low confidence.\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--summary",
|
||||
default=True,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Show the summary after a save operation.\n",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--raw",
|
||||
action="store_true",
|
||||
help="""With -p, will print out the raw tag block(s)\nfrom the file.\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"-R",
|
||||
"--recursive",
|
||||
action="store_true",
|
||||
help="Recursively include files in sub-folders.",
|
||||
help="""Abort save operation when online match is of low confidence.""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
@ -168,8 +106,36 @@ def register_runtime(parser: settngs.Manager) -> None:
|
||||
help="Don't actually modify file (only relevant for -d, -s, or -r).\n\n",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting("--darkmode", action="store_true", help="Windows only. Force a dark pallet", file=False)
|
||||
parser.add_setting(
|
||||
"--summary",
|
||||
default=True,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Show the summary after a save operation.",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"-R",
|
||||
"--recursive",
|
||||
action="store_true",
|
||||
help="Recursively include files in sub-folders.",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting("-g", "--glob", action="store_true", help="Windows only. Enable globbing", file=False)
|
||||
parser.add_setting("--darkmode", action="store_true", help="Windows only. Force a dark pallet", file=False)
|
||||
parser.add_setting("--no-gui", action="store_true", help="Do not open the GUI, force the commandline", file=False)
|
||||
|
||||
parser.add_setting(
|
||||
"--abort-on-conflict",
|
||||
action="store_true",
|
||||
help="""Don't export to zip if intended new filename exists\n(otherwise, creates a new unique filename).\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--delete-original",
|
||||
action="store_true",
|
||||
help="""Delete original archive after successful export to Zip.\n(only relevant for -e)\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"-t",
|
||||
"--type-read",
|
||||
@ -209,13 +175,12 @@ def register_runtime(parser: settngs.Manager) -> None:
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--overwrite",
|
||||
"--skip-existing-metadata",
|
||||
action=argparse.BooleanOptionalAction,
|
||||
default=True,
|
||||
help="""Apply metadata to already tagged archives, otherwise skips archives with existing metadata (relevant for -s or -c).""",
|
||||
help="""Skip archives that already have tags specified with -t,\notherwise merges new metadata with existing metadata (relevant for -s or -c).""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting("--no-gui", action="store_true", help="Do not open the GUI, force the commandline", file=False)
|
||||
parser.add_setting("files", nargs="*", default=[], file=False)
|
||||
|
||||
|
||||
@ -238,7 +203,7 @@ def register_commands(parser: settngs.Manager) -> None:
|
||||
dest="command",
|
||||
action="store_const",
|
||||
const=Action.delete,
|
||||
help="Deletes the tag block of specified type (via --type-modify).\n",
|
||||
help="Deletes the tag block of specified type (via -t).",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
|
@ -6,7 +6,9 @@ import uuid
|
||||
import settngs
|
||||
|
||||
from comicapi import merge, utils
|
||||
from comicapi.genericmetadata import GenericMetadata
|
||||
from comictaggerlib.ctsettings.settngs_namespace import SettngsNS as ct_ns
|
||||
from comictaggerlib.ctsettings.types import parse_metadata_from_string
|
||||
from comictaggerlib.defaults import DEFAULT_REPLACEMENTS, Replacement, Replacements
|
||||
|
||||
|
||||
@ -41,7 +43,6 @@ def internal(parser: settngs.Manager) -> None:
|
||||
|
||||
|
||||
def identifier(parser: settngs.Manager) -> None:
|
||||
# identifier settings
|
||||
parser.add_setting(
|
||||
"--series-match-identify-thresh",
|
||||
default=91,
|
||||
@ -59,27 +60,7 @@ def identifier(parser: settngs.Manager) -> None:
|
||||
"--border-crop-percent",
|
||||
default=10,
|
||||
type=int,
|
||||
help="ComicTagger will automatically add an additional cover that has any black borders cropped. If the difference in height is less than %(default)s%% the cover will not be cropped.",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--publisher-filter",
|
||||
default=["Panini Comics", "Abril", "Planeta DeAgostini", "Editorial Televisa", "Dino Comics"],
|
||||
action="extend",
|
||||
nargs="+",
|
||||
help="When enabled, filters the listed publishers from all search results. Ending a publisher with a '-' removes a publisher from this list",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--clear-metadata",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Clears all existing metadata during import, default is to merge metadata.\nMay be used in conjunction with -o, -f and -m.\n\n",
|
||||
)
|
||||
parser.add_setting(
|
||||
"-a",
|
||||
"--auto-imprint",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Enables the auto imprint functionality.\ne.g. if the publisher is set to 'vertigo' it\nwill be updated to 'DC Comics' and the imprint\nproperty will be set to 'Vertigo'.\n\n",
|
||||
help="ComicTagger will automatically add an additional cover that has any black borders cropped.\nIf the difference in height is less than %(default)s%% the cover will not be cropped.\n\n",
|
||||
)
|
||||
|
||||
parser.add_setting(
|
||||
@ -94,23 +75,15 @@ def identifier(parser: settngs.Manager) -> None:
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Puts series that are an exact match at the top of the list",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--always-use-publisher-filter",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Enables the publisher filter",
|
||||
)
|
||||
|
||||
|
||||
def dialog(parser: settngs.Manager) -> None:
|
||||
# Show/ask dialog flags
|
||||
parser.add_setting("show_disclaimer", default=True, cmdline=False)
|
||||
parser.add_setting("dont_notify_about_this_version", default="", cmdline=False)
|
||||
parser.add_setting("ask_about_usage_stats", default=True, cmdline=False)
|
||||
|
||||
|
||||
def filename(parser: settngs.Manager) -> None:
|
||||
# filename parsing settings
|
||||
parser.add_setting(
|
||||
"--filename-parser",
|
||||
default=utils.Parser.ORIGINAL,
|
||||
@ -123,19 +96,19 @@ def filename(parser: settngs.Manager) -> None:
|
||||
"--remove-c2c",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Removes c2c from filenames. Requires --complicated-parser",
|
||||
help="Removes c2c from filenames.\nRequires --complicated-parser\n\n",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--remove-fcbd",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Removes FCBD/free comic book day from filenames. Requires --complicated-parser",
|
||||
help="Removes FCBD/free comic book day from filenames.\nRequires --complicated-parser\n\n",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--remove-publisher",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Attempts to remove publisher names from filenames, currently limited to Marvel and DC. Requires --complicated-parser",
|
||||
help="Attempts to remove publisher names from filenames, currently limited to Marvel and DC.\nRequires --complicated-parser\n\n",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--split-words",
|
||||
@ -147,18 +120,17 @@ def filename(parser: settngs.Manager) -> None:
|
||||
"--protofolius-issue-number-scheme",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Use an issue number scheme devised by protofolius for encoding format information as a letter in front of an issue number. Implies --allow-issue-start-with-letter. Requires --complicated-parser",
|
||||
help="Use an issue number scheme devised by protofolius for encoding format information as a letter in front of an issue number.\nImplies --allow-issue-start-with-letter. Requires --complicated-parser\n\n",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--allow-issue-start-with-letter",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Allows an issue number to start with a single letter (e.g. '#X01'). Requires --complicated-parser",
|
||||
help="Allows an issue number to start with a single letter (e.g. '#X01').\nRequires --complicated-parser\n\n",
|
||||
)
|
||||
|
||||
|
||||
def talker(parser: settngs.Manager) -> None:
|
||||
# General settings for talkers
|
||||
parser.add_setting(
|
||||
"--source",
|
||||
default="comicvine",
|
||||
@ -175,27 +147,26 @@ def talker(parser: settngs.Manager) -> None:
|
||||
|
||||
def md_options(parser: settngs.Manager) -> None:
|
||||
# CBL Transform settings
|
||||
parser.add_setting("--cbl-assume-lone-credit-is-primary", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--cbl-copy-characters-to-tags", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--cbl-copy-teams-to-tags", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--cbl-copy-locations-to-tags", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--cbl-copy-storyarcs-to-tags", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--cbl-copy-notes-to-comments", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--cbl-copy-weblink-to-comments", default=False, action=argparse.BooleanOptionalAction)
|
||||
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("--assume-lone-credit-is-primary", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--copy-characters-to-tags", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--copy-teams-to-tags", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--copy-locations-to-tags", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--copy-storyarcs-to-tags", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--copy-notes-to-comments", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--copy-weblink-to-comments", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--apply-transform-on-import", default=False, action=argparse.BooleanOptionalAction)
|
||||
parser.add_setting("--apply-transform-on-bulk-operation", default=False, action=argparse.BooleanOptionalAction)
|
||||
|
||||
parser.add_setting("use_short_metadata_names", default=False, action=argparse.BooleanOptionalAction, cmdline=False)
|
||||
parser.add_setting(
|
||||
"--disable-cr",
|
||||
default=False,
|
||||
"--cr",
|
||||
default=True,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Disable the ComicRack metadata type",
|
||||
help="Enable the ComicRack metadata type. Turn off to only use the CIX metadata type.",
|
||||
)
|
||||
|
||||
|
||||
def rename(parser: settngs.Manager) -> None:
|
||||
# Rename settings
|
||||
parser.add_setting("--template", default="{series} #{issue} ({year})", help="The teplate to use when renaming")
|
||||
parser.add_setting(
|
||||
"--issue-number-padding",
|
||||
@ -229,7 +200,7 @@ def rename(parser: settngs.Manager) -> None:
|
||||
help="Ignores the filename when moving renamed files to a separate directory",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--strict",
|
||||
"--strict-filenames",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Ensures that filenames are valid for all OSs",
|
||||
@ -238,7 +209,13 @@ def rename(parser: settngs.Manager) -> None:
|
||||
|
||||
|
||||
def autotag(parser: settngs.Manager) -> None:
|
||||
# Auto-tag stickies
|
||||
parser.add_setting(
|
||||
"-o",
|
||||
"--online",
|
||||
action="store_true",
|
||||
help="""Search online and attempt to identify file\nusing existing metadata and images in archive.\nMay be used in conjunction with -f and -m.\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--save-on-low-confidence",
|
||||
default=False,
|
||||
@ -246,10 +223,10 @@ def autotag(parser: settngs.Manager) -> None:
|
||||
help="Automatically save metadata on low-confidence matches",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--dont-use-year-when-identifying",
|
||||
"--dont-use-year-when-auto-tagging",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Ignore the year metadata attribute when identifying a comic",
|
||||
help="Ignore the year metadata attribute when auto-tagging a comic",
|
||||
)
|
||||
parser.add_setting(
|
||||
"-1",
|
||||
@ -265,12 +242,60 @@ def autotag(parser: settngs.Manager) -> None:
|
||||
help="When searching ignore leading numbers in the filename",
|
||||
)
|
||||
parser.add_setting("remove_archive_after_successful_match", default=False, cmdline=False)
|
||||
parser.add_setting(
|
||||
"-f",
|
||||
"--parse-filename",
|
||||
action="store_true",
|
||||
help="""Parse the filename to get some info,\nspecifically series name, issue number,\nvolume, and publication year.\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--id",
|
||||
dest="issue_id",
|
||||
type=str,
|
||||
help="""Use the issue ID when searching online.\nOverrides all other metadata.\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"-m",
|
||||
"--metadata",
|
||||
default=GenericMetadata(),
|
||||
type=parse_metadata_from_string,
|
||||
help="""Explicitly define some tags to be used in YAML syntax. Use @file.yaml to read from a file. e.g.:\n"series: Plastic Man, publisher: Quality Comics, year: "\n"series: 'Kickers, Inc.', issue: '1', year: 1986"\nIf you want to erase a tag leave the value blank.\nSome names that can be used: series, issue, issue_count, year,\npublisher, title\n\n""",
|
||||
file=False,
|
||||
)
|
||||
parser.add_setting(
|
||||
"--clear-metadata",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Clears all existing metadata during import, default is to merge metadata.\nMay be used in conjunction with -o, -f and -m.\n\n",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--publisher-filter",
|
||||
default=["Panini Comics", "Abril", "Planeta DeAgostini", "Editorial Televisa", "Dino Comics"],
|
||||
action="extend",
|
||||
nargs="+",
|
||||
help="When enabled, filters the listed publishers from all search results.\nEnding a publisher with a '-' removes a publisher from this list\n\n",
|
||||
)
|
||||
parser.add_setting(
|
||||
"--use-publisher-filter",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Enables the publisher filter",
|
||||
)
|
||||
parser.add_setting(
|
||||
"-a",
|
||||
"--auto-imprint",
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Enables the auto imprint functionality.\ne.g. if the publisher is set to 'vertigo' it\nwill be updated to 'DC Comics' and the imprint\nproperty will be set to 'Vertigo'.\n\n",
|
||||
)
|
||||
|
||||
|
||||
def parse_filter(config: settngs.Config[ct_ns]) -> settngs.Config[ct_ns]:
|
||||
new_filter = []
|
||||
remove = []
|
||||
for x in config[0].Issue_Identifier__publisher_filter:
|
||||
for x in config[0].Auto_Tag__publisher_filter:
|
||||
x = x.strip()
|
||||
if x: # ignore empty arguments
|
||||
if x[-1] == "-": # this publisher needs to be removed. We remove after all publishers have been enumerated
|
||||
@ -281,7 +306,7 @@ def parse_filter(config: settngs.Config[ct_ns]) -> settngs.Config[ct_ns]:
|
||||
for x in remove: # remove publishers
|
||||
if x in new_filter:
|
||||
new_filter.remove(x)
|
||||
config[0].Issue_Identifier__publisher_filter = new_filter
|
||||
config[0].Auto_Tag__publisher_filter = new_filter
|
||||
return config
|
||||
|
||||
|
||||
|
@ -32,7 +32,7 @@ def archiver(manager: settngs.Manager) -> None:
|
||||
manager.add_setting(
|
||||
f"--{settngs.sanitize_name(archiver.exe)}",
|
||||
default=archiver.exe,
|
||||
help="Path to the %(default)s executable\n\n",
|
||||
help="Path to the %(default)s executable",
|
||||
)
|
||||
|
||||
|
||||
|
@ -19,29 +19,25 @@ class SettngsNS(settngs.TypedNS):
|
||||
|
||||
Runtime_Options__config: comictaggerlib.ctsettings.types.ComicTaggerPaths
|
||||
Runtime_Options__verbose: int
|
||||
Runtime_Options__abort_on_conflict: bool
|
||||
Runtime_Options__delete_original: bool
|
||||
Runtime_Options__parse_filename: bool
|
||||
Runtime_Options__issue_id: str | None
|
||||
Runtime_Options__online: bool
|
||||
Runtime_Options__metadata: comicapi.genericmetadata.GenericMetadata
|
||||
Runtime_Options__interactive: bool
|
||||
Runtime_Options__abort_on_low_confidence: bool
|
||||
Runtime_Options__summary: bool
|
||||
Runtime_Options__raw: bool
|
||||
Runtime_Options__recursive: bool
|
||||
Runtime_Options__dryrun: bool
|
||||
Runtime_Options__darkmode: bool
|
||||
Runtime_Options__glob: bool
|
||||
Runtime_Options__quiet: bool
|
||||
Runtime_Options__json: bool
|
||||
Runtime_Options__type_modify: list[str]
|
||||
Runtime_Options__raw: bool
|
||||
Runtime_Options__interactive: bool
|
||||
Runtime_Options__abort_on_low_confidence: bool
|
||||
Runtime_Options__dryrun: bool
|
||||
Runtime_Options__summary: bool
|
||||
Runtime_Options__recursive: bool
|
||||
Runtime_Options__glob: bool
|
||||
Runtime_Options__darkmode: bool
|
||||
Runtime_Options__no_gui: bool
|
||||
Runtime_Options__abort_on_conflict: bool
|
||||
Runtime_Options__delete_original: bool
|
||||
Runtime_Options__type_read: list[str]
|
||||
Runtime_Options__type_modify: list[str]
|
||||
Runtime_Options__read_style_overlay: comicapi.merge.Mode
|
||||
Runtime_Options__source_overlay: comicapi.merge.Mode
|
||||
Runtime_Options__overlay_merge_lists: bool
|
||||
Runtime_Options__overwrite: bool
|
||||
Runtime_Options__no_gui: bool
|
||||
Runtime_Options__skip_existing_metadata: bool
|
||||
Runtime_Options__files: list[str]
|
||||
|
||||
internal__install_id: str
|
||||
@ -61,14 +57,10 @@ class SettngsNS(settngs.TypedNS):
|
||||
internal__sort_direction: int
|
||||
|
||||
Issue_Identifier__series_match_identify_thresh: int
|
||||
Issue_Identifier__border_crop_percent: int
|
||||
Issue_Identifier__publisher_filter: list[str]
|
||||
Issue_Identifier__series_match_search_thresh: int
|
||||
Issue_Identifier__clear_metadata: bool
|
||||
Issue_Identifier__auto_imprint: bool
|
||||
Issue_Identifier__border_crop_percent: int
|
||||
Issue_Identifier__sort_series_by_year: bool
|
||||
Issue_Identifier__exact_series_matches_first: bool
|
||||
Issue_Identifier__always_use_publisher_filter: bool
|
||||
|
||||
Filename_Parsing__filename_parser: comicapi.utils.Parser
|
||||
Filename_Parsing__remove_c2c: bool
|
||||
@ -81,17 +73,17 @@ class SettngsNS(settngs.TypedNS):
|
||||
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
|
||||
Metadata_Options__cbl_copy_teams_to_tags: bool
|
||||
Metadata_Options__cbl_copy_locations_to_tags: bool
|
||||
Metadata_Options__cbl_copy_storyarcs_to_tags: bool
|
||||
Metadata_Options__cbl_copy_notes_to_comments: bool
|
||||
Metadata_Options__cbl_copy_weblink_to_comments: bool
|
||||
Metadata_Options__cbl_apply_transform_on_import: bool
|
||||
Metadata_Options__cbl_apply_transform_on_bulk_operation: bool
|
||||
Metadata_Options__assume_lone_credit_is_primary: bool
|
||||
Metadata_Options__copy_characters_to_tags: bool
|
||||
Metadata_Options__copy_teams_to_tags: bool
|
||||
Metadata_Options__copy_locations_to_tags: bool
|
||||
Metadata_Options__copy_storyarcs_to_tags: bool
|
||||
Metadata_Options__copy_notes_to_comments: bool
|
||||
Metadata_Options__copy_weblink_to_comments: bool
|
||||
Metadata_Options__apply_transform_on_import: bool
|
||||
Metadata_Options__apply_transform_on_bulk_operation: bool
|
||||
Metadata_Options__use_short_metadata_names: bool
|
||||
Metadata_Options__disable_cr: bool
|
||||
Metadata_Options__cr: bool
|
||||
|
||||
File_Rename__template: str
|
||||
File_Rename__issue_number_padding: int
|
||||
@ -100,14 +92,22 @@ class SettngsNS(settngs.TypedNS):
|
||||
File_Rename__dir: str
|
||||
File_Rename__move: bool
|
||||
File_Rename__only_move: bool
|
||||
File_Rename__strict: bool
|
||||
File_Rename__strict_filenames: bool
|
||||
File_Rename__replacements: comictaggerlib.defaults.Replacements
|
||||
|
||||
Auto_Tag__online: bool
|
||||
Auto_Tag__save_on_low_confidence: bool
|
||||
Auto_Tag__dont_use_year_when_identifying: bool
|
||||
Auto_Tag__dont_use_year_when_auto_tagging: bool
|
||||
Auto_Tag__assume_issue_one: bool
|
||||
Auto_Tag__ignore_leading_numbers_in_filename: bool
|
||||
Auto_Tag__remove_archive_after_successful_match: bool
|
||||
Auto_Tag__parse_filename: bool
|
||||
Auto_Tag__issue_id: str | None
|
||||
Auto_Tag__metadata: comicapi.genericmetadata.GenericMetadata
|
||||
Auto_Tag__clear_metadata: bool
|
||||
Auto_Tag__publisher_filter: list[str]
|
||||
Auto_Tag__use_publisher_filter: bool
|
||||
Auto_Tag__auto_imprint: bool
|
||||
|
||||
General__check_for_new_version: bool
|
||||
General__prompt_on_save: bool
|
||||
@ -132,29 +132,25 @@ class Commands(typing.TypedDict):
|
||||
class Runtime_Options(typing.TypedDict):
|
||||
config: comictaggerlib.ctsettings.types.ComicTaggerPaths
|
||||
verbose: int
|
||||
abort_on_conflict: bool
|
||||
delete_original: bool
|
||||
parse_filename: bool
|
||||
issue_id: str | None
|
||||
online: bool
|
||||
metadata: comicapi.genericmetadata.GenericMetadata
|
||||
interactive: bool
|
||||
abort_on_low_confidence: bool
|
||||
summary: bool
|
||||
raw: bool
|
||||
recursive: bool
|
||||
dryrun: bool
|
||||
darkmode: bool
|
||||
glob: bool
|
||||
quiet: bool
|
||||
json: bool
|
||||
type_modify: list[str]
|
||||
raw: bool
|
||||
interactive: bool
|
||||
abort_on_low_confidence: bool
|
||||
dryrun: bool
|
||||
summary: bool
|
||||
recursive: bool
|
||||
glob: bool
|
||||
darkmode: bool
|
||||
no_gui: bool
|
||||
abort_on_conflict: bool
|
||||
delete_original: bool
|
||||
type_read: list[str]
|
||||
type_modify: list[str]
|
||||
read_style_overlay: comicapi.merge.Mode
|
||||
source_overlay: comicapi.merge.Mode
|
||||
overlay_merge_lists: bool
|
||||
overwrite: bool
|
||||
no_gui: bool
|
||||
skip_existing_metadata: bool
|
||||
files: list[str]
|
||||
|
||||
|
||||
@ -178,14 +174,10 @@ class internal(typing.TypedDict):
|
||||
|
||||
class Issue_Identifier(typing.TypedDict):
|
||||
series_match_identify_thresh: int
|
||||
border_crop_percent: int
|
||||
publisher_filter: list[str]
|
||||
series_match_search_thresh: int
|
||||
clear_metadata: bool
|
||||
auto_imprint: bool
|
||||
border_crop_percent: int
|
||||
sort_series_by_year: bool
|
||||
exact_series_matches_first: bool
|
||||
always_use_publisher_filter: bool
|
||||
|
||||
|
||||
class Filename_Parsing(typing.TypedDict):
|
||||
@ -204,17 +196,17 @@ class Sources(typing.TypedDict):
|
||||
|
||||
|
||||
class Metadata_Options(typing.TypedDict):
|
||||
cbl_assume_lone_credit_is_primary: bool
|
||||
cbl_copy_characters_to_tags: bool
|
||||
cbl_copy_teams_to_tags: bool
|
||||
cbl_copy_locations_to_tags: bool
|
||||
cbl_copy_storyarcs_to_tags: bool
|
||||
cbl_copy_notes_to_comments: bool
|
||||
cbl_copy_weblink_to_comments: bool
|
||||
cbl_apply_transform_on_import: bool
|
||||
cbl_apply_transform_on_bulk_operation: bool
|
||||
assume_lone_credit_is_primary: bool
|
||||
copy_characters_to_tags: bool
|
||||
copy_teams_to_tags: bool
|
||||
copy_locations_to_tags: bool
|
||||
copy_storyarcs_to_tags: bool
|
||||
copy_notes_to_comments: bool
|
||||
copy_weblink_to_comments: bool
|
||||
apply_transform_on_import: bool
|
||||
apply_transform_on_bulk_operation: bool
|
||||
use_short_metadata_names: bool
|
||||
disable_cr: bool
|
||||
cr: bool
|
||||
|
||||
|
||||
class File_Rename(typing.TypedDict):
|
||||
@ -225,16 +217,24 @@ class File_Rename(typing.TypedDict):
|
||||
dir: str
|
||||
move: bool
|
||||
only_move: bool
|
||||
strict: bool
|
||||
strict_filenames: bool
|
||||
replacements: comictaggerlib.defaults.Replacements
|
||||
|
||||
|
||||
class Auto_Tag(typing.TypedDict):
|
||||
online: bool
|
||||
save_on_low_confidence: bool
|
||||
dont_use_year_when_identifying: bool
|
||||
dont_use_year_when_auto_tagging: bool
|
||||
assume_issue_one: bool
|
||||
ignore_leading_numbers_in_filename: bool
|
||||
remove_archive_after_successful_match: bool
|
||||
parse_filename: bool
|
||||
issue_id: str | None
|
||||
metadata: comicapi.genericmetadata.GenericMetadata
|
||||
clear_metadata: bool
|
||||
publisher_filter: list[str]
|
||||
use_publisher_filter: bool
|
||||
auto_imprint: bool
|
||||
|
||||
|
||||
class General(typing.TypedDict):
|
||||
|
@ -111,7 +111,7 @@ class IssueIdentifier:
|
||||
self.series_match_thresh = config.Issue_Identifier__series_match_identify_thresh
|
||||
|
||||
# used to eliminate unlikely publishers
|
||||
self.publisher_filter = [s.strip().casefold() for s in config.Issue_Identifier__publisher_filter]
|
||||
self.publisher_filter = [s.strip().casefold() for s in config.Auto_Tag__publisher_filter]
|
||||
|
||||
self.additional_metadata = GenericMetadata()
|
||||
self.output_function: Callable[[str], None] = print
|
||||
|
@ -252,7 +252,7 @@ class App:
|
||||
# config already loaded
|
||||
error = None
|
||||
|
||||
if self.config[0].Metadata_Options__disable_cr:
|
||||
if not self.config[0].Metadata_Options__cr:
|
||||
if "cr" in comicapi.comicarchive.metadata_styles:
|
||||
del comicapi.comicarchive.metadata_styles["cr"]
|
||||
|
||||
|
@ -11,11 +11,11 @@ from comictalker.talker_utils import cleanup_html
|
||||
|
||||
|
||||
def prepare_metadata(md: GenericMetadata, new_md: GenericMetadata, opts: SettngsNS) -> GenericMetadata:
|
||||
if opts.Metadata_Options__cbl_apply_transform_on_import:
|
||||
if opts.Metadata_Options__apply_transform_on_import:
|
||||
new_md = CBLTransformer(new_md, opts).apply()
|
||||
|
||||
final_md = md.copy()
|
||||
if opts.Issue_Identifier__clear_metadata:
|
||||
if opts.Auto_Tag__clear_metadata:
|
||||
final_md = GenericMetadata()
|
||||
|
||||
final_md.overlay(new_md)
|
||||
@ -31,7 +31,7 @@ def prepare_metadata(md: GenericMetadata, new_md: GenericMetadata, opts: Settngs
|
||||
+ (f"[Issue ID {final_md.issue_id}]" if final_md.issue_id else "")
|
||||
)
|
||||
|
||||
if opts.Issue_Identifier__auto_imprint:
|
||||
if opts.Auto_Tag__auto_imprint:
|
||||
final_md.fix_publisher()
|
||||
|
||||
return final_md.replace(
|
||||
|
@ -67,7 +67,7 @@ class RenameWindow(QtWidgets.QDialog):
|
||||
self.rename_list: list[str] = []
|
||||
|
||||
self.btnSettings.clicked.connect(self.modify_settings)
|
||||
platform = "universal" if self.config[0].File_Rename__strict else "auto"
|
||||
platform = "universal" if self.config[0].File_Rename__strict_filenames else "auto"
|
||||
self.renamer = FileRenamer(None, platform=platform, replacements=self.config[0].File_Rename__replacements)
|
||||
|
||||
self.do_preview()
|
||||
|
@ -160,7 +160,7 @@ class SeriesSelectionWindow(QtWidgets.QDialog):
|
||||
self.progdialog: QtWidgets.QProgressDialog | None = None
|
||||
self.search_thread: SearchThread | None = None
|
||||
|
||||
self.use_filter = self.config.Issue_Identifier__always_use_publisher_filter
|
||||
self.use_filter = self.config.Auto_Tag__use_publisher_filter
|
||||
|
||||
# Load to retrieve settings
|
||||
self.talker = talker
|
||||
@ -407,7 +407,7 @@ class SeriesSelectionWindow(QtWidgets.QDialog):
|
||||
# filter the publishers if enabled set
|
||||
if self.use_filter:
|
||||
try:
|
||||
publisher_filter = {s.strip().casefold() for s in self.config.Issue_Identifier__publisher_filter}
|
||||
publisher_filter = {s.strip().casefold() for s in self.config.Auto_Tag__publisher_filter}
|
||||
# use '' as publisher name if None
|
||||
self.series_list = dict(
|
||||
filter(
|
||||
|
@ -334,9 +334,9 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
table.setItem(row, 1, QtWidgets.QTableWidgetItem(replace))
|
||||
tmp = QtWidgets.QTableWidgetItem()
|
||||
if strict_only:
|
||||
tmp.setCheckState(QtCore.Qt.Checked)
|
||||
tmp.setCheckState(QtCore.Qt.CheckState.Checked)
|
||||
else:
|
||||
tmp.setCheckState(QtCore.Qt.Unchecked)
|
||||
tmp.setCheckState(QtCore.Qt.CheckState.Unchecked)
|
||||
table.setItem(row, 2, tmp)
|
||||
|
||||
def rename_test(self, *args: Any, **kwargs: Any) -> None:
|
||||
@ -399,7 +399,7 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
self.leRarExePath.setEnabled(False)
|
||||
self.sbNameMatchIdentifyThresh.setValue(self.config[0].Issue_Identifier__series_match_identify_thresh)
|
||||
self.sbNameMatchSearchThresh.setValue(self.config[0].Issue_Identifier__series_match_search_thresh)
|
||||
self.tePublisherFilter.setPlainText("\n".join(self.config[0].Issue_Identifier__publisher_filter))
|
||||
self.tePublisherFilter.setPlainText("\n".join(self.config[0].Auto_Tag__publisher_filter))
|
||||
|
||||
self.cbxCheckForNewVersion.setChecked(self.config[0].General__check_for_new_version)
|
||||
|
||||
@ -414,21 +414,21 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
|
||||
self.switch_parser()
|
||||
|
||||
self.cbxUseFilter.setChecked(self.config[0].Issue_Identifier__always_use_publisher_filter)
|
||||
self.cbxUseFilter.setChecked(self.config[0].Auto_Tag__use_publisher_filter)
|
||||
self.cbxSortByYear.setChecked(self.config[0].Issue_Identifier__sort_series_by_year)
|
||||
self.cbxExactMatches.setChecked(self.config[0].Issue_Identifier__exact_series_matches_first)
|
||||
self.cbxClearFormBeforePopulating.setChecked(self.config[0].Issue_Identifier__clear_metadata)
|
||||
self.cbxClearFormBeforePopulating.setChecked(self.config[0].Auto_Tag__clear_metadata)
|
||||
|
||||
self.cbxAssumeLoneCreditIsPrimary.setChecked(self.config[0].Metadata_Options__cbl_assume_lone_credit_is_primary)
|
||||
self.cbxCopyCharactersToTags.setChecked(self.config[0].Metadata_Options__cbl_copy_characters_to_tags)
|
||||
self.cbxCopyTeamsToTags.setChecked(self.config[0].Metadata_Options__cbl_copy_teams_to_tags)
|
||||
self.cbxCopyLocationsToTags.setChecked(self.config[0].Metadata_Options__cbl_copy_locations_to_tags)
|
||||
self.cbxCopyStoryArcsToTags.setChecked(self.config[0].Metadata_Options__cbl_copy_storyarcs_to_tags)
|
||||
self.cbxCopyNotesToComments.setChecked(self.config[0].Metadata_Options__cbl_copy_notes_to_comments)
|
||||
self.cbxCopyWebLinkToComments.setChecked(self.config[0].Metadata_Options__cbl_copy_weblink_to_comments)
|
||||
self.cbxApplyCBLTransformOnCVIMport.setChecked(self.config[0].Metadata_Options__cbl_apply_transform_on_import)
|
||||
self.cbxAssumeLoneCreditIsPrimary.setChecked(self.config[0].Metadata_Options__assume_lone_credit_is_primary)
|
||||
self.cbxCopyCharactersToTags.setChecked(self.config[0].Metadata_Options__copy_characters_to_tags)
|
||||
self.cbxCopyTeamsToTags.setChecked(self.config[0].Metadata_Options__copy_teams_to_tags)
|
||||
self.cbxCopyLocationsToTags.setChecked(self.config[0].Metadata_Options__copy_locations_to_tags)
|
||||
self.cbxCopyStoryArcsToTags.setChecked(self.config[0].Metadata_Options__copy_storyarcs_to_tags)
|
||||
self.cbxCopyNotesToComments.setChecked(self.config[0].Metadata_Options__copy_notes_to_comments)
|
||||
self.cbxCopyWebLinkToComments.setChecked(self.config[0].Metadata_Options__copy_weblink_to_comments)
|
||||
self.cbxApplyCBLTransformOnCVIMport.setChecked(self.config[0].Metadata_Options__apply_transform_on_import)
|
||||
self.cbxApplyCBLTransformOnBatchOperation.setChecked(
|
||||
self.config[0].Metadata_Options__cbl_apply_transform_on_bulk_operation
|
||||
self.config[0].Metadata_Options__apply_transform_on_bulk_operation
|
||||
)
|
||||
self.cbxOverlayReadStyle.setCurrentIndex(
|
||||
self.cbxOverlayReadStyle.findData(self.config[0].internal__load_data_overlay.value)
|
||||
@ -438,7 +438,7 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
)
|
||||
self.cbxOverlayMergeLists.setChecked(self.config[0].internal__overlay_merge_lists)
|
||||
self.cbxShortMetadataNames.setChecked(self.config[0].Metadata_Options__use_short_metadata_names)
|
||||
self.cbxDisableCR.setChecked(self.config[0].Metadata_Options__disable_cr)
|
||||
self.cbxEnableCR.setChecked(self.config[0].Metadata_Options__cr)
|
||||
|
||||
self.leRenameTemplate.setText(self.config[0].File_Rename__template)
|
||||
self.leIssueNumPadding.setText(str(self.config[0].File_Rename__issue_number_padding))
|
||||
@ -447,7 +447,7 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
self.cbxMoveFiles.setChecked(self.config[0].File_Rename__move)
|
||||
self.cbxMoveOnly.setChecked(self.config[0].File_Rename__only_move)
|
||||
self.leDirectory.setText(self.config[0].File_Rename__dir)
|
||||
self.cbxRenameStrict.setChecked(self.config[0].File_Rename__strict)
|
||||
self.cbxRenameStrict.setChecked(self.config[0].File_Rename__strict_filenames)
|
||||
|
||||
for table, replacments in zip(
|
||||
(self.twLiteralReplacements, self.twValueReplacements), self.config[0].File_Rename__replacements
|
||||
@ -472,7 +472,7 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
Replacement(
|
||||
self.twLiteralReplacements.item(row, 0).text(),
|
||||
self.twLiteralReplacements.item(row, 1).text(),
|
||||
self.twLiteralReplacements.item(row, 2).checkState() == QtCore.Qt.Checked,
|
||||
self.twLiteralReplacements.item(row, 2).checkState() == QtCore.Qt.CheckState.Checked,
|
||||
)
|
||||
)
|
||||
for row in range(self.twValueReplacements.rowCount()):
|
||||
@ -481,7 +481,7 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
Replacement(
|
||||
self.twValueReplacements.item(row, 0).text(),
|
||||
self.twValueReplacements.item(row, 1).text(),
|
||||
self.twValueReplacements.item(row, 2).checkState() == QtCore.Qt.Checked,
|
||||
self.twValueReplacements.item(row, 2).checkState() == QtCore.Qt.CheckState.Checked,
|
||||
)
|
||||
)
|
||||
return Replacements(literal_replacements, value_replacements)
|
||||
@ -532,7 +532,7 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
|
||||
self.config[0].Issue_Identifier__series_match_identify_thresh = self.sbNameMatchIdentifyThresh.value()
|
||||
self.config[0].Issue_Identifier__series_match_search_thresh = self.sbNameMatchSearchThresh.value()
|
||||
self.config[0].Issue_Identifier__publisher_filter = utils.split(self.tePublisherFilter.toPlainText(), "\n")
|
||||
self.config[0].Auto_Tag__publisher_filter = utils.split(self.tePublisherFilter.toPlainText(), "\n")
|
||||
|
||||
self.config[0].Filename_Parsing__filename_parser = utils.Parser(self.cbFilenameParser.currentText())
|
||||
self.config[0].Filename_Parsing__remove_c2c = self.cbxRemoveC2C.isChecked()
|
||||
@ -543,29 +543,27 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
self.cbxProtofoliusIssueNumberScheme.isChecked()
|
||||
)
|
||||
|
||||
self.config[0].Issue_Identifier__always_use_publisher_filter = self.cbxUseFilter.isChecked()
|
||||
self.config[0].Auto_Tag__use_publisher_filter = self.cbxUseFilter.isChecked()
|
||||
self.config[0].Issue_Identifier__sort_series_by_year = self.cbxSortByYear.isChecked()
|
||||
self.config[0].Issue_Identifier__exact_series_matches_first = self.cbxExactMatches.isChecked()
|
||||
self.config[0].Issue_Identifier__clear_metadata = self.cbxClearFormBeforePopulating.isChecked()
|
||||
self.config[0].Auto_Tag__clear_metadata = self.cbxClearFormBeforePopulating.isChecked()
|
||||
|
||||
self.config[0].Metadata_Options__cbl_assume_lone_credit_is_primary = (
|
||||
self.cbxAssumeLoneCreditIsPrimary.isChecked()
|
||||
)
|
||||
self.config[0].Metadata_Options__cbl_copy_characters_to_tags = self.cbxCopyCharactersToTags.isChecked()
|
||||
self.config[0].Metadata_Options__cbl_copy_teams_to_tags = self.cbxCopyTeamsToTags.isChecked()
|
||||
self.config[0].Metadata_Options__cbl_copy_locations_to_tags = self.cbxCopyLocationsToTags.isChecked()
|
||||
self.config[0].Metadata_Options__cbl_copy_storyarcs_to_tags = self.cbxCopyStoryArcsToTags.isChecked()
|
||||
self.config[0].Metadata_Options__cbl_copy_notes_to_comments = self.cbxCopyNotesToComments.isChecked()
|
||||
self.config[0].Metadata_Options__cbl_copy_weblink_to_comments = self.cbxCopyWebLinkToComments.isChecked()
|
||||
self.config[0].Metadata_Options__cbl_apply_transform_on_import = self.cbxApplyCBLTransformOnCVIMport.isChecked()
|
||||
self.config.values.Metadata_Options__cbl_apply_transform_on_bulk_operation = (
|
||||
self.config[0].Metadata_Options__assume_lone_credit_is_primary = self.cbxAssumeLoneCreditIsPrimary.isChecked()
|
||||
self.config[0].Metadata_Options__copy_characters_to_tags = self.cbxCopyCharactersToTags.isChecked()
|
||||
self.config[0].Metadata_Options__copy_teams_to_tags = self.cbxCopyTeamsToTags.isChecked()
|
||||
self.config[0].Metadata_Options__copy_locations_to_tags = self.cbxCopyLocationsToTags.isChecked()
|
||||
self.config[0].Metadata_Options__copy_storyarcs_to_tags = self.cbxCopyStoryArcsToTags.isChecked()
|
||||
self.config[0].Metadata_Options__copy_notes_to_comments = self.cbxCopyNotesToComments.isChecked()
|
||||
self.config[0].Metadata_Options__copy_weblink_to_comments = self.cbxCopyWebLinkToComments.isChecked()
|
||||
self.config[0].Metadata_Options__apply_transform_on_import = self.cbxApplyCBLTransformOnCVIMport.isChecked()
|
||||
self.config.values.Metadata_Options__apply_transform_on_bulk_operation = (
|
||||
self.cbxApplyCBLTransformOnBatchOperation.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()
|
||||
self.config[0].Metadata_Options__disable_cr = self.cbxDisableCR.isChecked()
|
||||
self.config[0].Metadata_Options__cr = self.cbxEnableCR.isChecked()
|
||||
# Update metadata style names if required
|
||||
if self.config[0].Metadata_Options__use_short_metadata_names != self.cbxShortMetadataNames.isChecked():
|
||||
self.config[0].Metadata_Options__use_short_metadata_names = self.cbxShortMetadataNames.isChecked()
|
||||
@ -580,7 +578,7 @@ class SettingsWindow(QtWidgets.QDialog):
|
||||
self.config[0].File_Rename__only_move = self.cbxMoveOnly.isChecked()
|
||||
self.config[0].File_Rename__dir = self.leDirectory.text()
|
||||
|
||||
self.config[0].File_Rename__strict = self.cbxRenameStrict.isChecked()
|
||||
self.config[0].File_Rename__strict_filenames = self.cbxRenameStrict.isChecked()
|
||||
self.config[0].File_Rename__replacements = self.get_replacements()
|
||||
|
||||
# Read settings from talker tabs
|
||||
|
@ -1708,7 +1708,7 @@ class TaggerWindow(QtWidgets.QMainWindow):
|
||||
center_window_on_parent(prog_dialog)
|
||||
QtCore.QCoreApplication.processEvents()
|
||||
|
||||
if style == "cbi" and self.config[0].Metadata_Options__cbl_apply_transform_on_bulk_operation:
|
||||
if style == "cbi" and self.config[0].Metadata_Options__apply_transform_on_bulk_operation:
|
||||
md = CBLTransformer(md, self.config[0]).apply()
|
||||
|
||||
if ca.write_metadata(md, style):
|
||||
@ -1905,7 +1905,7 @@ class TaggerWindow(QtWidgets.QMainWindow):
|
||||
if ct_md is not None:
|
||||
temp_opts = cast(ct_ns, settngs.get_namespace(self.config, True, True, True, False)[0])
|
||||
if dlg.cbxRemoveMetadata.isChecked():
|
||||
temp_opts.Issue_Identifier__clear_metadata
|
||||
temp_opts.Auto_Tag__clear_metadata
|
||||
|
||||
md = prepare_metadata(md, ct_md, temp_opts)
|
||||
|
||||
|
@ -472,12 +472,12 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="cbxDisableCR">
|
||||
<widget class="QCheckBox" name="cbxEnableCR">
|
||||
<property name="toolTip">
|
||||
<string>Useful if you use the CIX metadata type</string>
|
||||
<string>Turn off to only use the CIX metadata type</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Disable ComicRack Metadata Type</string>
|
||||
<string>Enable ComicRack Metadata Type (needs a restart)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -36,14 +36,14 @@ def test_save(
|
||||
config[0].Commands__command = comictaggerlib.resulttypes.Action.save
|
||||
|
||||
# Check online, should be intercepted by comicvine_api
|
||||
config[0].Runtime_Options__online = True
|
||||
config[0].Auto_Tag__online = True
|
||||
# Use the temporary comic we created
|
||||
config[0].Runtime_Options__files = [tmp_comic.path]
|
||||
# Read and save ComicRack tags
|
||||
config[0].Runtime_Options__type_read = ["cr"]
|
||||
config[0].Runtime_Options__type_modify = ["cr"]
|
||||
# Search using the correct series since we just put the wrong series name in the CBZ
|
||||
config[0].Runtime_Options__metadata = comicapi.genericmetadata.GenericMetadata(series=md_saved.series)
|
||||
config[0].Auto_Tag__metadata = comicapi.genericmetadata.GenericMetadata(series=md_saved.series)
|
||||
# Run ComicTagger
|
||||
CLI(config[0], talkers).run()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user