Add Wikipedia provider and associated plumbing#3972
Conversation
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔒 Dependency Security Report✅ No dependency changes detected in this PR. |
|
Also don't forget about a Music provider itself providing a bio/description. For example Qobuz provides (localized) artist bio's |
|
I wrestled with this. I wasn't sure if a music provider returns a language code with the bio text so we know for certain what language it's in. I just checked Qobuz and it does, so I've changed Qobuz to populate the language field and adjusted the selection to favour music provider bios. The order is now: first bio in the user's preferred language wins (music, then TADB, then Wikipedia), otherwise keep an existing preferred language bio, otherwise fall back to English in that same order, and only use an unknown language bio as a last resort. I'll ask the other devs who populate artist.description to populate the language field too, but only when they know it for certain. If they leave it as None, that bio won't count as preferred language or English, so anything with a confident match will be used ahead of it. |
What does this implement/fix?
A new Wikipedia metadata provider that fetches artist biographies in the user's preferred language, falling back to English. It finds the right Wikipedia article via the artist's MusicBrainz links (and Wikidata where MusicBrainz doesn't list one), then pulls the article's intro text.
As there are now two biography-supplying metadata providers it is necessary to populate the database with the best one and in the right language. So this also:
Related issue (if applicable):
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.