Skip to content

log: later discs and series parts survive the log reader - #32

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-2eaa
Draft

cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-management-2eaa

Conversation

@cursor

@cursor cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown

Bug and impact

Two log-mode reader bugs left after #15 / #18:

  1. Later discs skipped. Each fix.csv row is processed on its own, but the never-expiring __cache__/book marker was keyed only on the book column. After grouping discs under the release folder, a later run (or a name-only marker from a prior hybrid pass) printed Skipping: … already processed for every remaining disc. cd2 never reached the library.

  2. Series part lost. Matched Audible/MAM rows still used setSeries(seriesparts), which splits on #. The log writes seriesparts as Name part. A matched row with a blanked paths column (the documented re-pin workflow) filed as Series 17.5 - Title and wrote that name into metadata.opf.

Root cause

  • isCached / cacheMe hashed MAMBook.name only. Log mode creates one MAMBook per row (hash("{i}-{book}")) but they share the same name.
  • #18 taught setSeriesFromLog to pair series + seriesparts for the id3 columns; the audible/mam rebuild in buildTreeFromLog was not switched over.

Fix

  • Log-mode rows set cacheKey to {book}|{fullpath}; getHashKey uses that when present. Hybrid mode is unchanged (still hashes the release name).
  • Audible/MAM series reconstruction uses setSeriesFromLog like the id3 columns.

Validation

  • Two-phase unit test: cd1-only run, then both rows — cd2 is filed; the already-filed disc is skipped. Confirmed the same test fails under the old name-only key.
  • Already-matched Pike Logan 17.5 row with blank paths files as Pike Logan #17.5 - Title and the OPF has calibre:series / series_index.
  • Full suite: 223 tests OK. Correctness and security review of the diff: clean after the test was rewritten to the incremental trigger.
Open in Web View Automation 

After #15, a multi-disc fix.csv uses the same book column for every disc.
The processed marker was keyed on that name only, so a later run (or a
name-only marker from hybrid) skipped remaining discs. Cache by
release+file in log mode.

The same reader still rebuilt Audible/MAM series with setSeries, which
splits on #; seriesparts is "Name part". Pair series + seriesparts the
way #18 already does for the id3 columns.

Co-authored-by: Mancolt <Mancolt@users.noreply.github.com>
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