Skip to content

grouping: do not merge different books that both use Audiobook/ - #34

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

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

Conversation

@cursor

@cursor cursor Bot commented Oct 3, 2026

Copy link
Copy Markdown

Bug and impact

Two mixed torrents that both use a kind folder were keyed as that folder and hardlinked to the first match:

  1. Title/Audiobook/ — The Guest/Audiobook/book.m4b and Along Came a Spider/Audiobook/book.m4b grouped as Audiobook.
  2. Title/Unabridged/ (also AUDIOBOOKS/, Audio Books/, Graphic Audio/) — same collision.

cd1/Audiobook/ and cd2/Audiobook/ also filed into one flat Author/Title/ folder, so the second disc was skipped.

cd1/ / MP3/ / 64k/ wrappers were already walked past (#15 / #20 / #22). Mixed MAM torrents that ship Audiobook/ next to eBook/ were not.

Root cause

isWrapperFolder only treated codec and bitrate names as wrappers. groupingName and discFolderFromPath then treated Audiobook as the release (or the disc).

Fix

Walk past kind folders (audiobook(s), audio book(s), unabridged, abridged, dramatized/dramatised, graphic audio) the same way as MP3/ and 64k/. Author/Title and loose-file grouping is unchanged.

Validation

  • Unit tests for Title/Audiobook, Title/Unabridged, AUDIOBOOKS, Audio Books, Graphic Audio, Author/Title/Audiobook, and cd1/Audiobook vs cd2/Audiobook filing.
  • Existing Release/cd1, Title/MP3, Title/64k and Author/Title cases unchanged.
  • python3 -m unittest discover -s tests -p 'test_*.py': 223 OK.
  • Correctness and security review of the diff: no findings.
Open in Web View Automation 

#15/#20/#22 walked past cd1/, MP3/ and 64k/, but two mixed torrents that
both use Title/Audiobook/ or Title/Unabridged/ were still keyed as
"Audiobook" and hardlinked to the first match. Walk past those kind
folders. Filing also walks past Audiobook/ under a disc so
cd1/Audiobook/ and cd2/Audiobook/ 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