/
/
# What does this implement/fix? If a queue still had shuffle switched on from an earlier listening session, pressing play on an album played it in random order — a surprise, because nothing on screen suggested the album would be reordered. Shuffle is now tied to the media it was set for. Starting something right away (play or replace) plays it in the order it comes in, unless you switched shuffle on moments before pressing play — that still counts as a deliberate "shuffle this" — or the client asks for shuffle explicitly. Adding items for later (add / play next) leaves the shuffle state alone. Switching shuffle off also puts the items that stay in the queue back in their original order, so the queue matches what the shuffle button says. This also adds the settings a client needs to make its click behaviour configurable, next to the enqueue defaults that already live on the queue controller — so every client (web, mobile, other MA clients) resolves the same behaviour from one shared, translated schema instead of each hardcoding its own. A frontend PR follows to use them, and to put a shuffle toggle in the play menu. **Related issue (if applicable):** - n/a ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives the label from the ticked box and applies it automatically; the release-notes generator uses that same label to slot this change into the next release notes. --> - [ ] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [x] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [ ] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Changes - Starting new media no longer inherits a shuffle left on by an earlier session. A shuffle switched on just before pressing play is still honoured, tracked by a runtime stamp that is never restored from cache. - Switching shuffle off restores the original order of the items that stay in the queue, so the queue and the shuffle indicator agree. - Clearing the queue switches shuffle off with it. - An explicit play-in-order is now honoured over a dynamic queue (radio / dynamic playlist) instead of being silently ignored. - Handing a queue to another player takes its shuffle state — and the intent behind it — along. - `play_media` accepts a `shuffle` argument so a client can start something shuffled, or in order, in one command. - New queue-controller settings for what clicking an artist, album or playlist does, and whether playing a track inside an album or playlist continues from there or plays just that track. Read by clients, not by the server. ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.