Pre-flight
Problem
When a book has no cover after the enrichers, fillCoverFromCoverProviders (internal/metadata/aggregator_enrichment.go) tries the ISBN of every edition with each CoverProvider, and takes the first cover that resolves. The edition's language is never consulted.
A work's editions often include its translations, and the only cover provider today, DNB's MVB service, mainly holds covers for German-market books. So a book in one language regularly ends up with a translation's cover, typically the German edition's: another title, another cover design, in another language. For example, with a Norwegian primary provider (#2995), a Norwegian novel without its own cover gets the German publisher's edition. In my library, 7 of one author's 34 books showed the German edition's cover.
Changing the order alone would not help: MVB has no cover for most non-German ISBNs, so the book's own-language editions fail and the translation's ISBN still wins.
Proposed solution
Only use an edition's ISBN for the cover when the edition is in the book's language, or when either language is unknown:
for _, ed := range book.Editions {
if book.Language != "" && ed.Language != "" && !sameLanguage(book.Language, ed.Language) {
continue // a translation's cover is another book's cover
}
// ... existing ISBN lookup
}
sameLanguage would treat the codes the language list already groups as one language (for example nob/nno/nor) as equal.
Effect:
Tests: a book with an own-language edition MVB cannot resolve and a translation it can → no cover; a German book → unchanged; editions without a language → unchanged.
Question: is "no cover" the right outcome when only a translation has one? An alternative is to keep the translation's cover as a last resort but let a later own-language cover replace it, but that needs a way to tell such a cover apart, so I'd start with the strict version.
Who is this for
Anyone whose books are not in German but have German translations, which covers most widely translated authors, and anyone using a non-English primary provider whose works list their translations' editions.
Alternatives considered
- Order the editions by language first: doesn't help, see above.
- Drop translations from a provider's editions: they are there on purpose, so a release or file of the translated edition still matches by ISBN.
- A setting to turn the fallback off: blunter; it also loses the covers it gets right.
Additional context
The enrichers' title-search covers can have the same problem (a work-level cover that happens to come from a translated edition), but that would need language data from each enricher, so it is out of scope here.
Pre-flight
Problem
When a book has no cover after the enrichers,
fillCoverFromCoverProviders(internal/metadata/aggregator_enrichment.go) tries the ISBN of every edition with eachCoverProvider, and takes the first cover that resolves. The edition's language is never consulted.A work's editions often include its translations, and the only cover provider today, DNB's MVB service, mainly holds covers for German-market books. So a book in one language regularly ends up with a translation's cover, typically the German edition's: another title, another cover design, in another language. For example, with a Norwegian primary provider (#2995), a Norwegian novel without its own cover gets the German publisher's edition. In my library, 7 of one author's 34 books showed the German edition's cover.
Changing the order alone would not help: MVB has no cover for most non-German ISBNs, so the book's own-language editions fail and the translation's ISBN still wins.
Proposed solution
Only use an edition's ISBN for the cover when the edition is in the book's language, or when either language is unknown:
sameLanguagewould treat the codes the language list already groups as one language (for examplenob/nno/nor) as equal.Effect:
Tests: a book with an own-language edition MVB cannot resolve and a translation it can → no cover; a German book → unchanged; editions without a language → unchanged.
Question: is "no cover" the right outcome when only a translation has one? An alternative is to keep the translation's cover as a last resort but let a later own-language cover replace it, but that needs a way to tell such a cover apart, so I'd start with the strict version.
Who is this for
Anyone whose books are not in German but have German translations, which covers most widely translated authors, and anyone using a non-English primary provider whose works list their translations' editions.
Alternatives considered
Additional context
The enrichers' title-search covers can have the same problem (a work-level cover that happens to come from a translated edition), but that would need language data from each enricher, so it is out of scope here.