diff --git a/comictaggerlib/cli.py b/comictaggerlib/cli.py index d52034c..72d7c7d 100644 --- a/comictaggerlib/cli.py +++ b/comictaggerlib/cli.py @@ -547,8 +547,9 @@ class CLI: md=prepare_metadata(md, ct_md, self.config), tags_written=self.config.Runtime_Options__type, ) + assert res.md # ok, done building our metadata. time to save - if self.actual_metadata_save(ca, md): + if self.actual_metadata_save(ca, res.md): match_results.good_matches.append(res) else: res.status = Status.write_failure diff --git a/comictaggerlib/md.py b/comictaggerlib/md.py index 4f3363a..d4a7990 100644 --- a/comictaggerlib/md.py +++ b/comictaggerlib/md.py @@ -24,11 +24,10 @@ def prepare_metadata(md: GenericMetadata, new_md: GenericMetadata, opts: Settngs f"Tagged with ComicTagger {ctversion.version} using info from {final_md.tag_origin.name} on" f" {datetime.now():%Y-%m-%d %H:%M:%S}. [Issue ID {final_md.issue_id}]" ) - final_md.replace( - notes=utils.combine_notes(md.notes, notes, "Tagged with ComicTagger"), - description=cleanup_html(md.description, opts.Sources__remove_html_tables), - ) if opts.Issue_Identifier__auto_imprint: - md.fix_publisher() - return final_md + final_md.fix_publisher() + return final_md.replace( + notes=utils.combine_notes(new_md.notes, notes, "Tagged with ComicTagger"), + description=cleanup_html(new_md.description, opts.Sources__remove_html_tables), + ) diff --git a/tests/conftest.py b/tests/conftest.py index 16e36d0..e8b1096 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -139,7 +139,7 @@ def mock_now(monkeypatch): def now(cls): return cls.time - monkeypatch.setattr(comictaggerlib.cli, "datetime", mydatetime) + monkeypatch.setattr(comictaggerlib.md, "datetime", mydatetime) @pytest.fixture