Skip to content

grouping: do not merge different books that both use MP3/ - #20

Merged
Mancolt merged 1 commit into
mainfrom
cursor/critical-bug-management-535f
Sep 19, 2026
Merged

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

Conversation

@cursor

@cursor cursor Bot commented Sep 19, 2026

Copy link
Copy Markdown

Bug and impact

Two releases that both use a codec folder (The Guest/MP3/, Along Came a Spider/MP3/) were grouped as one book named MP3 and hardlinked to the first match. A multi-disc layout Title/cd1/MP3/01.mp3 + Title/cd2/MP3/01.mp3 (already grouped as one book since #15) was filed into a flat Author/Title/ folder, so the second disc's same-named tracks were silently skipped.

Root cause

groupingName (PR #15) walked past FORMAT_FOLDER only when the parent was a DISC_FOLDER. Title/MP3/file.mp3 therefore keyed on MP3. getConfigTargetPath used the immediate parent, so cd1/MP3 looked like a non-disc folder named MP3.

Fix

  • Walk past codec folders (MP3/, M4B/, …) the same way we already walk past cd1/.
  • When the immediate parent is a codec folder under a disc, file using the disc name so the two discs get distinct targets.
  • Author/Title layouts, loose files, and Title/MP3/ (not a disc) are unchanged except they no longer collide with each other.

Validation

  • New unit tests for both layouts; they fail on the old parent_is_disc and FORMAT_FOLDER guard.
  • Full suite: 203 tests OK. ruff clean. Correctness and security review of the working-tree diff: no findings.
Open in Web View Automation 

#15 walked past cd1/MP3/ but treated Title/MP3/ as the release, so two
downloads that both used a codec folder were keyed as "MP3" and hardlinked
to the first match. Walk past FORMAT_FOLDER always. Filing also uses the
disc parent of cd1/MP3/ so the second disc is not skipped.

Co-authored-by: Mancolt <Mancolt@users.noreply.github.com>
@Mancolt
Mancolt marked this pull request as ready for review September 19, 2026 20:54
@Mancolt
Mancolt merged commit 2ad7c03 into main Sep 19, 2026
2 checks passed
@Mancolt
Mancolt deleted the cursor/critical-bug-management-535f branch September 19, 2026 20:57
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