Skip to content

Restore PlayerQueue.is_dynamic after loading queue from cache#3948

Merged
MarvinSchenkel merged 1 commit into
music-assistant:devfrom
dmoo500:fix/restore-is-dynamic-from-cache
May 22, 2026
Merged

Restore PlayerQueue.is_dynamic after loading queue from cache#3948
MarvinSchenkel merged 1 commit into
music-assistant:devfrom
dmoo500:fix/restore-is-dynamic-from-cache

Conversation

@dmoo500
Copy link
Copy Markdown
Contributor

@dmoo500 dmoo500 commented May 22, 2026

Summary

Fixes a bug where PlayerQueue.is_dynamic was not correctly restored when a queue was loaded from cache on server startup.

Problem

PlayerQueue.from_cache() (in music-assistant-models) reconstructs radio_source internally, but does not recalculate is_dynamic. After a server restart, any queue that had a dynamic playlist in its radio_source would have is_dynamic = False until the user replayed the playlist.

PR #3886 set is_dynamic at all direct queue.radio_source = assignments, but missed this indirect path via from_cache().

Fix

After calling queue.from_cache(prev_state), recalculate is_dynamic from the restored radio_source.

Related

Copilot AI review requested due to automatic review settings May 22, 2026 11:40
Copy link
Copy Markdown
Contributor

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

Note

Copilot was unable to run its full agentic suite in this review.

This PR updates player queue restoration to recompute queue.is_dynamic after loading cached queue state, ensuring older cache entries (without the field) behave correctly.

Changes:

  • Recompute queue.is_dynamic after queue.from_cache(prev_state) using _is_radio_source_dynamic(queue.radio_source).

Comment thread music_assistant/controllers/player_queues.py
@dmoo500 dmoo500 force-pushed the fix/restore-is-dynamic-from-cache branch from c187f96 to 63d52ab Compare May 22, 2026 11:44
Copy link
Copy Markdown
Contributor

@MarvinSchenkel MarvinSchenkel left a comment

Choose a reason for hiding this comment

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

Thanks @dmoo500

@MarvinSchenkel MarvinSchenkel merged commit d6fa243 into music-assistant:dev May 22, 2026
7 of 9 checks passed
@dmoo500 dmoo500 deleted the fix/restore-is-dynamic-from-cache branch May 22, 2026 11:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants