Repository navigation
Reading lists find every volume of a series name (#1053) - #1054
Merged
Merged
Conversation
A codex Series is a name, a comicbox series is one volume run, and the importer folded every volume's start year into one Series.start_year, which comic_references stamped on every comic. comicbox treats a start year as the volume's identity, so Batman (2011) #1 read as a 1940-volume comic and every later volume went missing. - Volume.start_year, fed by the importer from each comic's series.start_year (earliest in a batch, last non-null across batches, as for the series). comic_references uses it, and gives series ids only for a series with one volume. - Migration 0062: backfill a series' only volume; rewrite codex-built references by the three rules (a year-like volume that contradicts the start year; a linked hand or tagged entry takes its volume's year; an unlinked one loses a same-named multi-volume series' year), dropping folded series ids; clear non-manual name, mapping and series-id matches in multi-volume series; mark a one-time re-read pending. - The librarian, at its first start after 0062, force-reads the lowest live comic of each yearless volume of a multi-volume series and queues a full rematch. An import that changes a volume's start year now queues a rematch too, since such a re-read changes no comic row. - Restore unfolds references from a dump made before 0062. - Matcher: review flag when the best comics' volumes conflict (comicbox's any_conflict); the mapping and series-id tiers look per volume, keep the volumes that agree with the entry, then those of its cover year (exact, then within one), and flag review when conflicting volumes remain. series_key uses comicbox's discriminators. 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.
Fixes #1053: reading lists missed every volume of a series name after the first.
Root cause. A codex
Seriesis a name. A comicbox series is one volume run. The importer folded every volume'sseries.start_yearinto oneSeries.start_year, andcomic_referencesstamped that year on every comic. comicbox treats the start year as the volume's identity, so Batman (2011) #1 read as a 1940-volume comic.What changed
Part 1: a start year per volume
Volume.start_year. The importer fills it from each comic'sseries.start_year: the earliest in a batch, the last non-null across batches, the same merge the series uses. A comic with no Volume tag gives its year to the null volume.comic_referencesnow emitsvolume__start_year. It emits series ids only for a series with one volume; the multi-volume series are found in one extra query per batch._0062_volume_start_years.py):exact_name/normalized_name/mapping/series_idmatches in multi-volume series so they get matched again.TimestampkeyVYtopending.queue_unstamped_tags_sync, but a state check would fire again on every start for volumes whose comics carry no start year. So the migration leaves a marker. At the librarian's next start,queue_volume_start_yearsqueues aForceUpdateComicsTaskfor the lowest live comic of each yearless volume of a multi-volume series, queues a fullReadingListRematchTask, and clears the marker.counts.comicstays 0 and_queue_rematchnever fired (checked in a test). The importer now counts volume start-year changes (Counts.volume_years), and_queue_rematchfires on those too.volume_years.unfold_reference).Part 2: codex's own tiers
_pickflags review when the best comics' volumes conflict, using comicbox'sany_conflictoverdiscriminators(candidates[pk]). One run filed under both "v2" and "(2011)" does not conflict.series_keyusesdiscriminators(reference).year, which removes codex's copiedYEAR_LIKE_VOLUME.Reproduction (the issue's CBL through
import_document, one Series "Batman" with volumes 1940/2011/2016)Before (develop's matcher and references):
After:
Gates
Develop was merged first (nothing new).
make fixpasses with no changes to files outside this PR.make lintpasses with 0 errors and 0 warnings.make typasses.make test(no dev server running) passes: pytest 2879 passed, 2 skipped; vitest 1462 passed. All 16 new matcher, combine and export tests and the restore test fail on develop's code.Known limits
Series.identifieris still one per name. A per-volume identifier is deferred.Not built / not verified
match_comicsfirst for mapped entries). It needs a second, per-seriesmatch_comicspass with renamed candidates, which is not small.🤖 Generated with Claude Code