Allow description and description_language to overwrite in MediaItemMetadata.update()#232
Merged
Conversation
Biographical information can change over time or the user can change the preferred language for metadata so description needs to be updated
marcelveldt
reviewed
May 23, 2026
There was a problem hiding this comment.
Pull request overview
This PR updates MediaItemMetadata.update() to allow description/description_language to be overwritten when the incoming description language differs from the currently stored language, while keeping the existing “fill-the-gap” behavior for other metadata fields to preserve provider priority.
Changes:
- Adds special-case handling for
description+description_languageto overwrite on language change, otherwise only fill when missing. - Excludes
descriptionanddescription_languagefrom the generic dataclass-field merge loop. - Refactors the overwrite-vs-fill logic for
popularityandlast_refreshinto a single conditional branch.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
MarvinSchenkel
pushed a commit
to music-assistant/server
that referenced
this pull request
May 25, 2026
Update music-assistant-models to version [1.1.125](https://github.com/music-assistant/models/releases/tag/1.1.125) ## 🚀 Features and enhancements - Allow description and description_language to overwrite in MediaItemMetadata.update() (by @OzGav in [#232](music-assistant/models#232)) ## 🙇 Contributors @OzGav Co-authored-by: marcelveldt <6389780+marcelveldt@users.noreply.github.com>
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.
Biographical information can change over time, and the user can change the preferred language for metadata, so description needs to be allowed to refresh but only when the incoming language actually differs from the stored one. Otherwise it follows the same fill-the-gap rule as the other scalar fields, so provider priority is honoured (e.g. a higher-priority provider that ran first keeps its bio if a lower-priority one would have provided the same language).
The language may differ from the stored one because a higher level provider may not have a bio in the users prefered language.