Skip to content

feat: add native AudiobookDB metadata provider - #5682

Draft
djdembeck wants to merge 3 commits into
advplyr:masterfrom
laxamentumtech:djdembeck/feat-audiobookdb-provider-upstream
Draft

djdembeck wants to merge 3 commits into
advplyr:masterfrom
laxamentumtech:djdembeck/feat-audiobookdb-provider-upstream

Conversation

@djdembeck

@djdembeck djdembeck commented Oct 28, 2026 •

Copy link
Copy Markdown

Brief summary

AudiobookDB becomes a first-class metadata source for books: manual matching, quick match, cover searches, and library scans now use a native provider that talks directly to the AudiobookDB API with an operator-provided account key. Previously AudiobookDB coverage was incomplete in several matching flows and release-specific data did not survive to the library.

Which issue is fixed?

None — this adds a native metadata provider rather than fixing a reported issue.

In-depth Description

AudiobookDB hosts one of the deepest audiobook release catalogs, but its data model (one book, many releases) does not map cleanly onto generic providers. A library item is a specific recording, so a title-only match can attach the wrong release's edition and metadata. A native provider that understands releases, and that treats provider failures as distinct from an empty catalog, is what makes the source reliable for matching and scanning instead of a partial fallback.

Covers are the other release-level identity: the server stores a downloaded cover verbatim, so a resized display derivative silently becomes the permanent cover. The provider therefore requests the catalog image's full-resolution original (sourceUrl) and only falls back to the largest documented CDN derivative (1200px /detail.jpg) when no original is available.

Changes

  • Books, release (quick) matches, and covers are resolved through the native provider with exact recording identity: explicit ASIN lookups stay pinned to their stored recording, and relaxations never substitute a different recording.
  • Covers use the full-resolution sourceUrl original, with the 1200px /detail.jpg derivative only as a fallback, so applying a cover no longer downgrades the stored image.
  • Provider failures (missing or rejected account key, quota throttling, upstream errors) are typed, actionable errors shown to the operator — never silent catalog misses — and throttling carries retry timing.
  • Selected-item batch matching stops cleanly on failure while retaining completed updates; whole-library matching fails the task with an actionable message, and a fresh run starts cleanly afterward.
  • The matching interface shows contextual setup guidance for the server-side account key and a restrained "Metadata from AudiobookDB" attribution; a failed batch reports an honest error with the actual completed and unmatched counts.
  • The README lists AudiobookDB in the feature overview with the mandatory AUDIOBOOKDB_API_KEY prerequisite, leaving setup, quota, and matching details to the documentation sites.

How have you tested this?

  • Server suite: 530 passing (npm test) at this PR head, including loopback transport tests for search, covers-only lookups, and the batch failure paths; eslint clean on every changed file.
  • Server build (tsc -p tsconfig.server.json) passes.
  • Mapping verified read-only against the live AudiobookDB API: GET /api/books/{id} DTO shape, plus CDN checks for the sourceUrl, /detail.jpg, /large.jpg, /medium.jpg, and /small.jpg variants (real dimensions and byte sizes). One full cover download was exercised through CoverManager.downloadCoverFromUrlNew and stored at the original 2400×2400 size.
  • Matching behavior demonstrated against a real compiled server with loopback API fixtures (including keyless/429/retry timing), not a live catalog.
  • Client component suites and client static generation were verified when the provider commit was prepared (110 component tests passing); the two follow-up commits touch only server code, server tests, and the README.

Screenshots

Not attached yet. The client changes are the match modal provider/ASIN field, the batch failure reporting, and the AudiobookDB attribution; before/after captures can be added when the branch is marked ready for review.

Support recording-specific AudiobookDB metadata and cover matching
through the native provider workflow with an operator account key.

Preserve exact ASIN identity and bound query and hydration work. Surface
key and quota failures, stop failed batches without losing completed
updates, and document setup with contextual source attribution.
@djdembeck
djdembeck marked this pull request as draft October 28, 2026 14:08
Audiobookshelf stores a downloaded cover verbatim, so the 768px
/large.jpg derivative permanently downgraded every applied cover.
Prefer the API's full-resolution sourceUrl original and fall back to
the 1200px /detail.jpg derivative when an original is unavailable.
The readme is a product overview: provider selection, matching
edge cases, key setup, quota accounting, and the compose override
belong in the docs sites, not here. Keep the advertised feature and
the mandatory AUDIOBOOKDB_API_KEY prerequisite in one line.
@nichwall

Copy link
Copy Markdown
Contributor

Very high level review from just skimming the code:

  • frontend changes to the existing Vue frontend aren't being merged since the React client is just about ready for release and the Vue client will not be updated/removed
  • Documentation updates about providers should go to the documentation site (Audiobookshelf.com), not the readme
  • I saw updates to the scanner logic. Scanning local files and matching against an online provider have been separate and distinct actions, I think changing this is out of scope for adding a new metadata provider

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.

2 participants