From 8cb114061466fea4caeff98b43d986adac9c30d0 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sun, 23 Jun 2024 15:08:43 -0700 Subject: [PATCH] Fix rename of read_all_tags Fixes #659 Fix --skip-existing-tags Fixes #658 --- comictaggerlib/autotagmatchwindow.py | 2 +- comictaggerlib/cli.py | 4 ++-- comictaggerlib/renamewindow.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/comictaggerlib/autotagmatchwindow.py b/comictaggerlib/autotagmatchwindow.py index 6e3640e..7148fac 100644 --- a/comictaggerlib/autotagmatchwindow.py +++ b/comictaggerlib/autotagmatchwindow.py @@ -226,7 +226,7 @@ class AutoTagMatchWindow(QtWidgets.QDialog): def save_match(self) -> None: match = self.current_match() ca = ComicArchive(self.current_match_set.original_path) - md, error = self.parent().read_all_tags(self._tags, ca) + md, error = self.parent().read_selected_tags(self._tags, ca) if error is not None: logger.error("Failed to load tags for %s: %s", ca.path, error) QtWidgets.QApplication.restoreOverrideCursor() diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py index 474a0d1..b5bbc57 100644 --- a/comictaggerlib/cli.py +++ b/comictaggerlib/cli.py @@ -347,7 +347,7 @@ class CLI: def _copy_tags(self, ca: ComicArchive, md: GenericMetadata, source_names: str, dst_tag_id: str) -> Status: dst_tag_name = tags[dst_tag_id].name() - if not self.config.Runtime_Options__skip_existing_tags and ca.has_tags(dst_tag_id): + if self.config.Runtime_Options__skip_existing_tags and ca.has_tags(dst_tag_id): self.output(f"{ca.path}: Already has {dst_tag_name} tags. Not overwriting.") return Status.existing_tags @@ -398,7 +398,7 @@ class CLI: return res def save(self, ca: ComicArchive, match_results: OnlineMatchResults) -> tuple[Result, OnlineMatchResults]: - if not self.config.Runtime_Options__skip_existing_tags: + if self.config.Runtime_Options__skip_existing_tags: for tag_id in self.config.Runtime_Options__tags_write: if ca.has_tags(tag_id): self.output(f"{ca.path}: Already has {tags[tag_id].name()} tags. Not overwriting.") diff --git a/comictaggerlib/renamewindow.py b/comictaggerlib/renamewindow.py index 03d7d37..fc3d03f 100644 --- a/comictaggerlib/renamewindow.py +++ b/comictaggerlib/renamewindow.py @@ -82,7 +82,7 @@ class RenameWindow(QtWidgets.QDialog): new_ext = ca.extension() if md is None or md.is_empty: - md, error = self.parent().read_all_tags(self.read_tag_ids, ca) + md, error = self.parent().read_selected_tags(self.read_tag_ids, ca) if error is not None: logger.error("Failed to load tags from %s: %s", ca.path, error) QtWidgets.QMessageBox.warning(