Skip to content

Restore radio_source media objects in PlayerQueue.from_cache#212

Merged
marcelveldt merged 1 commit intomusic-assistant:mainfrom
dmoo500:fix/radio-source-deserialization
Apr 28, 2026
Merged

Restore radio_source media objects in PlayerQueue.from_cache#212
marcelveldt merged 1 commit intomusic-assistant:mainfrom
dmoo500:fix/radio-source-deserialization

Conversation

@dmoo500
Copy link
Copy Markdown
Contributor

@dmoo500 dmoo500 commented Apr 23, 2026

Problem

After a server restart, PlayerQueue.from_cache() correctly rebuilds enqueued_media_items by calling media_from_dict on each raw dict from the cache. However, radio_source was not handled the same way — mashumaro deserializes it as plain dict objects instead of proper MediaItemType instances, depending on the version.

This causes isinstance checks (e.g. isinstance(item, Playlist)) in _fill_radio_tracks() on the server to silently fail after a restart, breaking radio/shuffle playback.

Fix

Apply the same media_from_dict reconstruction to radio_source in from_cache(), identical to the existing pattern for enqueued_media_items.

Fixes music-assistant/server#3766

@marcelveldt marcelveldt merged commit a386ee4 into music-assistant:main Apr 28, 2026
3 checks passed
@dmoo500 dmoo500 deleted the fix/radio-source-deserialization branch April 28, 2026 17:49
MarvinSchenkel pushed a commit to music-assistant/server that referenced this pull request Apr 29, 2026
Update music-assistant-models to version
[1.1.116](https://github.com/music-assistant/models/releases/tag/1.1.116)


- Revert "Add Recommendations Updated event" (by @MarvinSchenkel in
[#214](music-assistant/models#214))
- Restore radio_source media objects in PlayerQueue.from_cache (by
@dmoo500 in [#212](music-assistant/models#212))

## 🚀 Features and enhancements

- Add Recommendations Updated event (by @OzGav in
[#208](music-assistant/models#208))
- Add artist_type to Artist (by @fmunkes in
[#209](music-assistant/models#209))

## 🧰 Maintenance and dependency bumps

<details>
<summary>5 changes</summary>

- Build(deps): Bump release-drafter/release-drafter from 7.1.0 to 7.2.0
(by @[dependabot[bot]](https://github.com/apps/dependabot) in
[#204](music-assistant/models#204))
- Build(deps-dev): Bump tomli from 2.4.0 to 2.4.1 (by
@[dependabot[bot]](https://github.com/apps/dependabot) in
[#193](music-assistant/models#193))
- Build(deps): Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0
(by @[dependabot[bot]](https://github.com/apps/dependabot) in
[#203](music-assistant/models#203))
- Build(deps-dev): Bump pytest from 9.0.2 to 9.0.3 (by
@[dependabot[bot]](https://github.com/apps/dependabot) in
[#206](music-assistant/models#206))
- Build(deps-dev): Bump mypy from 1.20.0 to 1.20.1 (by
@[dependabot[bot]](https://github.com/apps/dependabot) in
[#211](music-assistant/models#211))
</details>


## 🙇 Contributors

@MarvinSchenkel, @OzGav, @dmoo500 and @fmunkes

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants