mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
feat(authors): add Goodreads as an author metadata source
Audnexus was the only author provider, and it returns just an ASIN, name, description and image. Goodreads carries a far richer author record, so add it as a second provider and let each field choose where it comes from. The Goodreads API was retired in 2020, so the provider scrapes: a name resolves to an author id through the WAF-free /book/auto_complete endpoint, falling back to the author search page for names that only differ by a middle initial, and the author page yields the biography, photo, birth and death dates, website, genres and influences. Two rendering quirks are worth knowing about, since both silently return the wrong value: free-text fields appear twice, truncated and whole, so the parser takes whichever copy carries the most content; and the birthplace sits in a bare text node while only the date is wrapped in a dataItem, so authors with a place but no date correctly store nothing. Preferences are now per field, mirroring the book-side FieldPreference model, with an ordered provider list and a merge strategy each. They are global, because an author row is shared across every library and cannot hold a different biography per library. Providers declare which fields they can return and both the resolver and the settings UI filter on that, so Audnexus can never be assigned to a field it has no way to fill. The single global write mode is migrated into each field's merge strategy on first read, keeping an existing install's overwrite behaviour instead of silently adopting the default. The executor now queries every listed provider and resolves each field independently, first non-empty value winning, and records which provider supplied the record so a re-run can pin the match instead of searching by name again. overwriteIfProvided skips empty values, which is what lets a matched author with an empty Audnexus biography fall through to Goodreads.
This commit is contained in:
@@ -1113,10 +1113,6 @@
|
||||
"runAllShort": "Executar todos",
|
||||
"enableTitle": "Ativar enriquecimento automático de autor",
|
||||
"enableHint": "Buscar automaticamente biografias e fotos de perfil de autores quando livros forem adicionados ou atualizados.",
|
||||
"updateStrategyTitle": "Estratégia de atualização",
|
||||
"updateStrategyHint": "O que fazer quando um autor já possui uma biografia ou foto.",
|
||||
"writeModeMissingOnly": "Preencher apenas dados ausentes (recomendado)",
|
||||
"writeModeAlwaysRefetch": "Sempre atualizar os dados existentes",
|
||||
"triggerOnImportTitle": "Disparar na importação",
|
||||
"triggerOnImportHint": "Colocar autores na fila para enriquecimento quando os livros forem adicionados pela primeira vez a uma biblioteca.",
|
||||
"eligibilityTitle": "Condições de elegibilidade",
|
||||
|
||||
Reference in New Issue
Block a user