Skip to content

series: missing Audible/MAM part no longer aborts the run - #24

Merged
Mancolt merged 2 commits into
mainfrom
cursor/critical-bug-management-d57e
Sep 22, 2026
Merged

Mancolt merged 2 commits into
mainfrom
cursor/critical-bug-management-d57e

Conversation

@cursor

@cursor cursor Bot commented Sep 22, 2026

Copy link
Copy Markdown

Bug and impact

Matching a book that Audible lists in a series without a sequence (companion books, unnumbered entries) raised KeyError in product2Book. _rankAudible does not catch that, so the whole run exited 1 and every later book was skipped. The same crash happened in getMAMBook when MAM series_info was ["Name"] or ["Name", null] (IndexError on s[1]). When the part was present but null, str(None) filed the book as Series #None - Title instead of using in_series_no_part.

Root cause

product2Book required s["sequence"]. getMAMBook required a second list element. #17 already treated an empty part as in_series_no_part, but a missing/null part never reached that path.

Fix

  • product2Book walks series with s.get("sequence") and skips entries that are not a dict with a title.
  • getMAMBook treats a missing or null second element as no part.
  • Series.__post_init__ coerces None/int parts to strings so getSeriesPart cannot crash and in_series_no_part is used.

Validation

  • New unit tests for missing/null/int parts on Audible products, MAM series_info, and getConfigTargetPath. They fail on the old s["sequence"] / s[1] access.
  • Full suite: 207 tests OK. ruff clean. Correctness and security review of the working-tree diff: no findings.

Also still awaiting review: the 64k/ grouping fix in #22

Open in Web View Automation 

cursoragent and others added 2 commits September 22, 2026 10:45
product2Book required series.sequence and getMAMBook required series_info[1],
so an unnumbered series entry crashed matching and skipped every later book.
Treat a missing/null part as empty (in_series_no_part) instead of "#None".

Co-authored-by: Mancolt <Mancolt@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Review of the rebased PR found that a null/number/bare-string value, or a null name, still raised TypeError or
filed the book under a series named None. Guard both, as product2Book already does for Audible.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Mancolt
Mancolt force-pushed the cursor/critical-bug-management-d57e branch from 09ce5b4 to 5d02741 Compare September 22, 2026 14:51
@Mancolt
Mancolt marked this pull request as ready for review September 22, 2026 14:56
@Mancolt
Mancolt merged commit 6d6c61b into main Sep 22, 2026
2 of 3 checks passed
@Mancolt
Mancolt deleted the cursor/critical-bug-management-d57e branch September 22, 2026 14:56
@Mancolt Mancolt mentioned this pull request Sep 22, 2026
Mancolt added a commit that referenced this pull request Sep 22, 2026
Moves the two ## Unreleased entries (#22 bitrate-folder grouping, #24 unnumbered series) under a ## 3.0.3 - 2026-09-22 heading. Tag v3.0.3 already points at the #24
merge commit and the image ghcr.io/mancolt/booktree:3.0.3 is built and deployed; this is the matching release note only. No code change.
Co-authored-by: Cursor <cursoragent@cursor.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.

2 participants