Skip to content

Allow description and description_language to overwrite in MediaItemMetadata.update()#232

Merged
marcelveldt merged 5 commits into
mainfrom
OzGav-patch-1
May 24, 2026
Merged

Allow description and description_language to overwrite in MediaItemMetadata.update()#232
marcelveldt merged 5 commits into
mainfrom
OzGav-patch-1

Conversation

@OzGav
Copy link
Copy Markdown
Contributor

@OzGav OzGav commented May 22, 2026

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.

Biographical information can change over time or the user can change the preferred language for metadata so description needs to be updated
@OzGav OzGav added the enhancement Enhancement of an existing feature/functionality label May 22, 2026
OzGav added 3 commits May 22, 2026 18:28
Refactor update method to handle description and description_language updates more effectively.
Comment thread music_assistant_models/media_items/metadata.py
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_language to overwrite on language change, otherwise only fill when missing.
  • Excludes description and description_language from the generic dataclass-field merge loop.
  • Refactors the overwrite-vs-fill logic for popularity and last_refresh into a single conditional branch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread music_assistant_models/media_items/metadata.py
Copy link
Copy Markdown
Member

@marcelveldt marcelveldt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @OzGav !

@marcelveldt marcelveldt merged commit c1685d6 into main May 24, 2026
3 checks passed
@marcelveldt marcelveldt deleted the OzGav-patch-1 branch May 24, 2026 12:50
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement of an existing feature/functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants