Skip to content

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

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

cursor[bot] wants to merge 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 

#20 walked past MP3/ but treated Title/64k/ and Title/MP3/64k/ as the
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>
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