Disclosure: This has been found with AI and the following has been written by AI. I still thought it'll be helpful
The is_likely_match substring check (beetsplug/audible.py L179) treats an empty string as matching everything, since "" in "anything" is always True in Python:
is_likely_match = (
normalized_album_name in normalized_book_title
or normalized_book_title in normalized_album_name
)
If album is missing/blank, or normalizes to "" (e.g. it was only punctuation or "(unabridged)"), every Audible result becomes a likely match. This feeds maybe_align_tracks_with_items, which can then rewrite the wrong book's chapter data.
Fix: require both sides to be non-empty first, e.g. normalized_album_name and normalized_book_title and (...).
Disclosure: This has been found with AI and the following has been written by AI. I still thought it'll be helpful
The
is_likely_matchsubstring check (beetsplug/audible.pyL179) treats an empty string as matching everything, since"" in "anything"is alwaysTruein Python:If
albumis missing/blank, or normalizes to""(e.g. it was only punctuation or "(unabridged)"), every Audible result becomes a likely match. This feedsmaybe_align_tracks_with_items, which can then rewrite the wrong book's chapter data.Fix: require both sides to be non-empty first, e.g.
normalized_album_name and normalized_book_title and (...).