Repository navigation
Online tagging saves series years, status and summary - #987
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-emptyseries.start_year/end_year/status/summaryout of a tag-write patch. Status is normalized through comicbox'sSeriesStatusEnum, so it is always aSeriesStatusChoicesvalue; unknown statuses are dropped.TagWriter._enqueue_rereadsattaches them to the re-readImportTaskas a newseries_attrsfield (path → attrs)._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 inper_comic_patches.Why at re-import, not a direct
Series.update()when the write is queuedThe suggested approach was a direct
Series.objects.filter(...).update(...)likeAdminSeriesAttrsView. 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
Test plan
tests/test_onlinetag_series_attrs.py, end to end. An untaggedSpidey 001.cbzis imported,TagPassRunnerflushes a stub Metron match that renames the series and publisher,TagWriterwrites ComicInfo, and the queued re-read runs through the importer. The comic's newMarvel / The Amazing Spider-Manrow 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.patch_series_attrs: enum member → value, unknown/empty dropped, no series.make fix,make lint,make ty,make test🤖 Generated with Claude Code