diff --git a/comicapi/genericmetadata.py b/comicapi/genericmetadata.py index 060c461..cf8c4cc 100644 --- a/comicapi/genericmetadata.py +++ b/comicapi/genericmetadata.py @@ -268,8 +268,8 @@ class GenericMetadata: return new # Create dict for deduplication - new_dict: dict[str, Credit] = {f"{norm_fold(n['person'])}_{n['role'].casefold()}": n for n in new} - cur_dict: dict[str, Credit] = {f"{norm_fold(c['person'])}_{c['role'].casefold()}": c for c in cur} + new_dict: dict[str, Credit] = {norm_fold(f"{n['person']}_{n['role']}"): n for n in new} + cur_dict: dict[str, Credit] = {norm_fold(f"{c['person']}_{c['role']}"): c for c in cur} # Any duplicates use the 'new' value cur_dict.update(new_dict) @@ -477,10 +477,13 @@ class GenericMetadata: credit = Credit(person=person, role=role, primary=primary) + person = norm_fold(person) + role = norm_fold(role) + # look to see if it's not already there... found = False for c in self.credits: - if norm_fold(c["person"]) == norm_fold(person) and norm_fold(c["role"]) == norm_fold(role): + if norm_fold(c["person"]) == person and norm_fold(c["role"]) == role: # no need to add it. just adjust the "primary" flag as needed c["primary"] = primary found = True diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py index b299304..6e7aa2c 100644 --- a/comictaggerlib/cli.py +++ b/comictaggerlib/cli.py @@ -29,7 +29,7 @@ from typing import Any, TextIO from comicapi import utils from comicapi.comicarchive import ComicArchive from comicapi.comicarchive import metadata_styles as md_styles -from comicapi.genericmetadata import GenericMetadata +from comicapi.genericmetadata import GenericMetadata, OverlayMode from comictaggerlib.cbltransformer import CBLTransformer from comictaggerlib.ctsettings import ct_ns from comictaggerlib.filerenamer import FileRenamer, get_rename_dir @@ -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) + md.overlay(self.config.Runtime_Options__metadata, mode=OverlayMode.overlay) return md