Fix prepare_metadata

This commit is contained in:
Timmy Welch 2024-04-27 16:43:51 -07:00
parent 9208a80ab0
commit 064795fac9
3 changed files with 8 additions and 8 deletions

View File

@ -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

View File

@ -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),
)

View File

@ -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