Add a free-text search provider backed by the configured metadata server

Aperta
#327 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
api, backend, search

Direzione di ricerca

Start at SearchForNewEntity and trace how /api/v1/search dispatches provider values and maps candidates into the add path; then inspect the configured metadata server setting and existing search provider helpers. Add New sends the provider parameter, and candidate author IDs must take precedence for this provider. Done means metadata-backed free-text candidates flow through the existing mapping and can be added without changing default provider behavior; the issue author offers to test against the chosen route.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

The server configured under Settings > Development as the metadata server is
already consulted for a lot: author import, book detail, lookups by a
canonical-prefixed id through book/lookup (a gr: or ol: term routes to
it there; whether the Hardcover branch of /api/v1/search does the same was
not traced), and the author cards decorating search results from the Goodreads,
Hardcover and Audible providers, conditionally (upstream: all three since
v0.9.958, Goodreads and Audible before that; in the fork the RanobeDB and
additional-source branches return through their own helpers and were not
seen to call it). What it is never consulted
for is the free-text candidates themselves. SearchForNewEntity dispatches a
free-text term to the additional-sources registry, RanobeDB, Audible,
Hardcover (the default) or Goodreads, each of which calls a fixed upstream
address, and the comment at the dispatch site records that as the intent
("search providers should hit their own upstream APIs only").

The request is one more provider in that dispatch, selectable where the
others are, whose candidate retrieval is a search call against the configured
metadata server, with the results then flowing through the same mapping the
other providers use. Concretely:

  1. A provider value (for example metadata) accepted by /api/v1/search's
    provider parameter, which is what the Add New page sends. book/lookup
    takes term and mediaType and no provider today; extending it is
    optional and not part of this ask.
  2. For that provider, candidates come from {MetadataServerUrl} (a search
    route of your choosing; term plus the requested media type is enough),
    and the ids they carry use the canonical prefixes the add path already
    accepts (gr, ol, az, with hc and gb where the server has them).
  3. On the add path, when a candidate came from that provider, prefer the
    author id the candidate carries over the fixed hc, gr, ol, gb
    order, so that a server without Hardcover ids can still complete an add.

Why: a self-hosted metadata server can already answer detail, author and
prefixed-id requests through the existing setting, but cannot be reached for
free-text discovery, so a user who runs one still depends on the fixed
upstreams for the one step that decides what can be added. This does not
change the default behaviour for anyone who does not select the provider,
and it does not touch the existing providers.

I am happy to test against a server that speaks the route you pick, and to
write the server-side counterpart.

Also filed on the ChaptarrNG fork, whose dispatch I read at fffa84e (0.9.978): https://github.com/snapetech-org/chaptarrng/issues/133

Lingua principale
C#
Stelle
664
Fork
48
Merge medio
5h 24m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Chaptarr/chaptarr

Tutte le issue di Chaptarr/chaptarr

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.