Metadata rescan: answer with the saved book, so callers don't have to read it back

Aperta Adatta ai principianti
#1,128 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à
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
csharp
Ambito
api, backend

Direzione di ricerca

Inizia da LibraryMetadataRescanWorkflow.cs, dove il libro salvato è disponibile come updatedAudiobook, e trova la risposta di successo di POST /api/v1/library/{id}/rescan-metadata. Confronta la struttura della risposta con quella di GET /library/{id} e aggiungi il libro salvato alla risposta di successo. Il lavoro è completato quando la risposta include un campo audiobook con la stessa struttura e i campi di risposta esistenti restano disponibili.

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

Descrizione

What happens

POST /api/v1/library/{id}/rescan-metadata answers a successful rescan with only

{ "message": "Metadata rescanned successfully", "audiobookId": 3, "source": "Audible", "asin": "B0F48KS3BX", "region": "fr" }

although the workflow holds the saved book at that point (updatedAudiobook in LibraryMetadataRescanWorkflow.cs). To show the book as it now is, a caller has to ask for it again with GET /library/{id}.

Why it matters

  • One more request per rescan, for data the server already had.
  • A second point of failure: if that read fails (a timeout, a network blip) after a successful rescan, the caller can't tell the user what the book became, and can wrongly report the rescan itself as failed. Repair (#1054) hit exactly this; it now reports such a book as repaired, read back or not, but still needs the extra request.

Suggested change

Add the saved book to the success answer, in the same shape as GET /library/{id} returns it:

{ "message": "Metadata rescanned successfully", "audiobookId": 3, "source": "Audible", "asin": "B0F48KS3BX", "region": "fr", "audiobook": { … } }

Additive: existing callers keep working. #1054 already uses audiobook when it is there and falls back to the read otherwise, so it drops the extra request as soon as this lands. Happy to send a small PR for it. Related: #1125 (book metadata epic, rescan rules).

Lingua principale
C#
Stelle
901
Fork
70
Merge medio
16h 27m
PR unite (30g)
60

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 Listenarrs/Listenarr

Tutte le issue di Listenarrs/Listenarr

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.