Skip to content

names: parse the grouping folder, not the first path component - #33

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

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

Conversation

@cursor

@cursor cursor Bot commented Oct 2, 2026

Copy link
Copy Markdown

Bug and impact

Junk-tag Audible searches parsed the first folder under source_path as the release name. Two common layouts then searched for the wrong title and cached a miss (the book marker never expires):

  1. Author/Title — Freida McFadden/The Guest/file.m4b parsed Freida McFadden as the title.
  2. Category/Release — completed/The Guest/file.m4b (typical qBittorrent category folder when source_path is the downloads root) parsed completed as the title.

cd1/ / MP3/ / 64k/ wrappers under a real release folder were already fine (Some Release/cd1/ still parsed Some Release).

Root cause

releaseNameForBook took rel.split(os.sep)[0]. That matches Release/file and Release/cd1/file, but not Author/Title or a category folder. Grouping already keys on the title/release folder (groupingName); parsing did not.

Fix

releaseNameForBook now returns groupingName(...) — the same folder used as the book key — and still falls back to the grouping key for a loose file or a path outside the source.

Validation

  • Unit tests for Author/Title, completed/Release, and Author/Title/cd1.
  • Matching test: junk AudioTrack 01 tags under those layouts search title:The Guest, not the author or completed.
  • Existing Release/cd1 and loose-file cases unchanged.
  • python3 -m unittest discover -s tests -p 'test_*.py': 222 OK.
  • Correctness and security review of the diff: no findings.
Open in Web View Automation 

Junk-tag searches used the first folder under source_path as the release
name. Author/Title (Freida McFadden/The Guest/) and category/Release
(completed/The Guest/) layouts then searched Audible for the author or
"completed" and cached a miss. Parse the same folder groupingName uses.

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