Skip to content

grouping: do not merge different books that both use 64k/ - #22

Merged
Mancolt merged 1 commit into
mainfrom
cursor/critical-bug-management-e44b
Sep 22, 2026
Merged

Mancolt merged 1 commit into
mainfrom
cursor/critical-bug-management-e44b

Conversation

@cursor

@cursor cursor Bot commented Sep 21, 2026

Copy link
Copy Markdown

Bug and impact

#20 walked past MP3/ but treated Title/64k/ and Title/MP3/64k/ as the release. Two downloads that both use a bitrate folder were keyed as 64k and hardlinked to the first match — the same class of merge as #15 (cd1/) and #20 (MP3/).

cd1/MP3/64k/01.mp3 and cd2/MP3/64k/01.mp3 also filed into one flat Author/Title/ folder, so the second disc was silently skipped.

Root cause

groupingName only skipped disc folders and codec names (mp3, m4b, …). A 64k/ / 128kbps/ quality folder is the immediate parent of the files on many MAM rips, so it became the grouping key. Filing only walked up one codec level, so a bitrate wrapper under cd1/MP3/ hid the disc.

Fix

Walk past bitrate folders (64k, 128kbps, 128 kbps, …) the same way codec folders are already skipped. Filing walks past codec and bitrate wrappers to find the disc parent.

Validation

  • Unit tests for two releases that both use 64k/ / MP3/64k/, and for cd1/MP3/64k vs cd2/MP3/64k getting distinct targets
  • python3 -m unittest discover -s tests: 205 tests, OK
  • Correctness and security review of the diff: no findings
Open in Web View Automation 

release, so two downloads that both used a bitrate folder were keyed as
"64k" and hardlinked to the first match. Walk past BITRATE_FOLDER always.
Filing also walks past codec/bitrate wrappers under a disc so
cd1/MP3/64k/ and cd2/MP3/64k/ get distinct subfolders.

Co-authored-by: Mancolt <Mancolt@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Mancolt
Mancolt force-pushed the cursor/critical-bug-management-e44b branch from 1e20cd8 to 65c137a Compare September 22, 2026 14:39
@Mancolt
Mancolt marked this pull request as ready for review September 22, 2026 14:44
@Mancolt
Mancolt merged commit 1318e1f into main Sep 22, 2026
2 of 3 checks passed
@Mancolt
Mancolt deleted the cursor/critical-bug-management-e44b branch September 22, 2026 14:44
@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