Skip to content

Online tagging saves series years, status and summary - #987

Merged
ajslater merged 1 commit into
developfrom
claude/infallible-neumann-5cbb6d
Oct 20, 2026
Merged

ajslater merged 1 commit into
developfrom
claude/infallible-neumann-5cbb6d

Conversation

@ajslater

Copy link
Copy Markdown
Owner

Summary

Online tagging fetches series end year, status and summary from Metron (start year and summary from Comic Vine), but none of the formats it writes can hold them. ComicInfo holds none and MetronInfo only the start year. The re-read after the write therefore lost them. Now they're saved to the database.

  • tagwrite_series_attrs.patch_series_attrs() pulls the non-empty series.start_year/end_year/status/summary out of a tag-write patch. Status is normalized through comicbox's SeriesStatusEnum, so it is always a SeriesStatusChoices value; unknown statuses are dropped.
  • TagWriter._enqueue_rereads attaches them to the re-read ImportTask as a new series_attrs field (path → attrs).
  • The importer lays them over the series the file names (_aggregate_path), before its usual series-attribute merge.

No changes were needed in onlinetag/. All three write sites (search pass, stored-id prepass, answered prompt) already put the full matched metadata in per_comic_patches.

Why at re-import, not a direct Series.update() when the write is queued

The suggested approach was a direct Series.objects.filter(...).update(...) like AdminSeriesAttrsView. That writes to the comic's current Series row, which is unique by (imprint, name). On a first online tag, the match usually sets a publisher and the canonical series name. The re-import then moves the comic to a different Series row, so the values would land on the old filename-derived row and be orphaned. Applying them during the re-read puts them on whichever row the comic ends up in.

Conflicts and clearing

  • Several comics of one series in one batch with different data: the importer's existing batch rules decide (earliest start, latest end, first comic's status and summary).
  • A later write's values replace the stored row's.
  • Empty values are never sent, so online data never clears a value.
  • A file-only re-import (watcher, poller) leaves the stored values alone.

Test plan

  • tests/test_onlinetag_series_attrs.py, end to end. An untagged Spidey 001.cbz is imported, TagPassRunner flushes a stub Metron match that renames the series and publisher, TagWriter writes ComicInfo, and the queued re-read runs through the importer. The comic's new Marvel / The Amazing Spider-Man row then has the start year, end year, status and summary. A second test checks that a later file-only re-import keeps them. Both tests fail with the importer overlay disabled.
  • Unit tests for patch_series_attrs: enum member → value, unknown/empty dropped, no series.
  • make fix, make lint, make ty, make test

🤖 Generated with Claude Code

A Metron match brings the series' end year, status and summary, and
Comic Vine its start year and summary. ComicInfo holds none of them and
MetronInfo only the start year, so the re-read after the write lost
them.

The tag writer now pulls those series attributes out of each comic's
patch and hands them to the re-read ImportTask, and the importer lays
them over the series the file names. Doing it during the import, rather
than updating the comic's Series row when the write is queued, puts the
values on the row the comic lands on: a match that names a new
publisher or series (the usual first tag of a comic whose series came
from its filename) moves the comic to a different row on re-import.

Comics of one series that disagree within a batch settle by the
importer's existing rules: earliest start year, latest end year, first
comic's status and summary. A later write replaces a stored row's
values. Empty values are dropped, so online data never clears one, and
a file-only re-import leaves them standing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ajslater
ajslater merged commit c24d99a into develop Oct 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant