Keep the chosen metadata language when other settings are saved - #5396
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a config persistence edge case where selecting the metadata language equal to the previous default (DEFAULT_LANGUAGE, e.g. en_US) could be dropped from stored core config on unrelated saves, allowing later clients/providers to overwrite the language as if it had never been chosen.
Changes:
- Removed
default_valuefrom the metadataCONF_LANGUAGEConfigEntryso an explicit choice is always persisted. - Kept
DEFAULT_LANGUAGEbehavior as the runtime fallback via thelocaleproperty when no language is stored. - Added regression tests covering save behavior for both the previous default language and a non-default language.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/controllers/metadata/test_preferred_language.py | Adds regression tests validating that an explicitly chosen language survives unrelated metadata config saves and cannot be overridden by default seeding afterward. |
| music_assistant/controllers/metadata/controller.py | Removes the config-entry default for CONF_LANGUAGE while keeping DEFAULT_LANGUAGE as the runtime fallback for reads. |
The language config entry declared en_US as its default. Since only values that differ from their default are stored, choosing English (US) dropped the key on the next save of the metadata settings, making it look like no language had ever been chosen. A client connecting afterwards could then silently replace it with its own browser language.
marcelveldt
force-pushed
the
fix-metadata-language-default
branch
from
August 6, 2026 09:24
86fb5e5 to
090c033
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this implement/fix?
If your metadata language was set to English (US), it could get silently replaced by the language of whatever browser or app connected next.
The language setting declared English (US) as its default value, and Music Assistant only stores settings that differ from their default. So choosing English (US) and then saving anything else on the Metadata settings page dropped the language from storage — after which it looked like no language had ever been chosen, and the next client to connect (or a Spotify/Qobuz login) would set its own.
The language setting no longer declares a default, so an explicit choice is always stored. English (US) is still what's used when nothing has been chosen yet.
Types of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChanges:
[Default], and shows no selection until a language has been picked or detected. The language actually used is still English (US) in that case.Checklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked.music-assistant/frontendis linked.