feat(metadata): expand book request discovery

Allow request searches to browse broader provider result sets, rerun queries by exact author, and submit unmatched titles for approval. Advertise the optional limit so older clients retain their existing contract.

Closes #1363
This commit is contained in:
neon
2026-10-20 18:27:02 +00:00
parent 2be79af880
commit 0d695a7ea0
25 changed files with 517 additions and 75 deletions
+6
View File
@@ -25,6 +25,12 @@ export const SERVER_FEATURES = [
* review reports `heldOnRequest`, `releaseInfoUrl`, `edition` and `hasCover` with a cover route.
*/
"book-request-review-hold",
/**
* `GET /metadata-fetch/stream` accepts `resultsPerProvider` (up to
* `METADATA_SEARCH_MAX_RESULTS_PER_PROVIDER`), and Open Library and Hardcover answer a search that
* names an author but no title.
*/
"metadata-search-results-per-provider",
] as const;
export type ServerFeature = (typeof SERVER_FEATURES)[number];
+7
View File
@@ -150,6 +150,13 @@ export interface MetadataProviderInfo {
*/
export const METADATA_PROVIDER_STATUS_EVENT = "provider-status";
/**
* The most ranked candidates one provider may contribute to a metadata search stream. A search for
* one book's match keeps the server's small default; a search that browses, such as finding a book
* to request, asks for up to this many with `resultsPerProvider`.
*/
export const METADATA_SEARCH_MAX_RESULTS_PER_PROVIDER = 20;
/** Why a provider stopped before finishing, so an interrupted search is not read as an empty one. */
export type MetadataProviderSearchOutcome = "timeout" | "throttled" | "failed";