Audible: fall back to a title/author search when a tagged ASIN is dea… - #23
Merged
Merged
Conversation
…d or names another book
A file tagged with an ASIN Audible has no product for (skeleton {asin, asset_details, is_vvab}: a withdrawn or
duplicate listing), or one that fails the title/author gate, was left unmatched: the per-ASIN endpoint ignores the
title/author parameters and nothing else was tried. Seen 2026-09-22 with "This Book Made Me Think of You" tagged
B0G2TK17DS (dead on every marketplace); the ABR request was B0FBHZK5V7.
- getAudibleBooks: the attempt ladder now lives in _runAudibleAttempts, which reports the ASIN it was directed at
and whether Audible answered that lookup. No match + answered ASIN -> rerun the ladder with the ASIN blanked
(noAsin also strips a [bracketed] release-name ASIN), starting from the file's original tag title (the legacy
rung's getAltTitle mutation must not leak into the search). Same gates and duration check as a tagless file.
A lookup that *failed* (outage, timeout) does not fall back: the tag may be right and a search could file
another edition for good; the book stays unmatched for the next run, as before.
- matchAttempt is prefixed asin-fallback: so the JSON run log can tell such a match apart.
- Interactive mode dropped: a skeleton answer was auto-accepted as the lone result and would have filed the book
under an empty title.
- bestAudibleMatch is reset at the start of a search; _rankAudible returns it as it stands, so a stale value from
an earlier search could have masked a miss.
Tests: 9 new cases (dead tag, live-but-wrong tag, gates still apply, live tag costs no extra query, attempt label,
title restore, bracket ASIN, interactive skeleton, failed lookup, stale match). Live --dry-run on the real file:
fallback finds B0FBHZK5V7, rate 84, duration difference 0 min. Replay of the 1602-book corpus against main:
3 matches gained (Takedown -> B01FEAW1SE), none lost, no target-path or OPF change.
Review findings addressed: correctness (title leak, bracket ASIN, interactive skeleton, stale match, attempt
label, replay) and security (fail-open on a transient Audible error).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…d or names another book
A file tagged with an ASIN Audible has no product for (skeleton {asin, asset_details, is_vvab}: a withdrawn or duplicate listing), or one that fails the title/author gate, was left unmatched: the per-ASIN endpoint ignores the title/author parameters and nothing else was tried. Seen 2026-09-22 with "This Book Made Me Think of You" tagged B0G2TK17DS (dead on every marketplace); the ABR request was B0FBHZK5V7.
Tests: 9 new cases (dead tag, live-but-wrong tag, gates still apply, live tag costs no extra query, attempt label, title restore, bracket ASIN, interactive skeleton, failed lookup, stale match). Live --dry-run on the real file: fallback finds B0FBHZK5V7, rate 84, duration difference 0 min. Replay of the 1602-book corpus against main: 3 matches gained (Takedown -> B01FEAW1SE), none lost, no target-path or OPF change.
Review findings addressed: correctness (title leak, bracket ASIN, interactive skeleton, stale match, attempt label, replay) and security (fail-open on a transient Audible error).