Skip to content

Audible: fall back to a title/author search when a tagged ASIN is dea… - #23

Merged
Mancolt merged 1 commit into
mainfrom
fix/tagged-asin-fallback
Sep 22, 2026
Merged

Mancolt merged 1 commit into
mainfrom
fix/tagged-asin-fallback

Conversation

@Mancolt

@Mancolt Mancolt commented Sep 22, 2026

Copy link
Copy Markdown
Owner

…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).

…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).
@Mancolt
Mancolt merged commit 9aa271a into main Sep 22, 2026
2 of 3 checks passed
@Mancolt
Mancolt deleted the fix/tagged-asin-fallback branch September 22, 2026 14:06
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