mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 08:21:39 -06:00
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:
@@ -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];
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user