Repository navigation
Add the locked part of the queue to the player queue - #495
Merged
Merged
Conversation
7 of 17 tasks
Member
Author
|
@Bot-MArley review |
Bot-MArley
reviewed
Nov 27, 2026
Bot-MArley
left a comment
Collaborator
There was a problem hiding this comment.
Note
This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.
Thanks @marcelveldt, this looks good. The new last_locked_index field sits right next to current_index / index_in_buffer, defaults to None, and needs no special serialization handling. It means the same thing in music-assistant/server#8246, which sets it in signal_update and keeps it out of the queue cache. Older payloads without the key still deserialize fine.
No changes requested. Two optional nits:
- The ticked type is "Maintenance", but this adds a new field that clients can read. Earlier field additions like
ended(#339) were labelledenhancement, so that label would put it in the right section of the release notes. - Other new queue fields came with a small default / round-trip test in
tests/test_player_queue.py. One here would keep that consistent, but it's not required for a plainint | Nonefield.
Next step: a maintainer can merge this. It needs to be released before music-assistant/server#8246 (and #8084 under it) can bump the models dependency.
marcelveldt
marked this pull request as ready for review
November 27, 2026 13:35
This was referenced Nov 27, 2026
marcelveldt
added a commit
to music-assistant/server
that referenced
this pull request
Nov 27, 2026
# What does this implement/fix? <!-- Quick description and explanation of changes. --> Stacked on #8084. Clients get the locked part of the queue as one queue field, `last_locked_index`, instead of an `extra_attributes` key next to `index_in_buffer`. That one value tells every client which items it may move or remove, so none of them has to combine it with `index_in_buffer` or repeat a server rule. ## Changes - The queue publishes the lock as `PlayerQueue.last_locked_index` (music-assistant/models#495). - The buffered next track counts as replaceable only while a track follows it. The lock covers the "last track can't be deleted" rule itself, so `delete_item` needs no special case. "Play next" while the next track is the last one lands after it. - The MCP queue tools follow the same lock. - API schema version 128, models 1.1.254. **Related issue (if applicable):** - stacked on #8084 - models music-assistant/models#495 - frontend music-assistant/frontend#3360 (stacked on music-assistant/frontend#3326) ## 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` - [ ] 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` - [x] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## 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. - [x] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [x] 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.
7 of 17 tasks
balloobbot
pushed a commit
to balloobbot/server
that referenced
this pull request
Nov 27, 2026
Update music-assistant-models to version [1.1.254](https://github.com/music-assistant/models/releases/tag/1.1.254) ## 🧰 Maintenance and dependency bumps - Add the locked part of the queue to the player queue (by @marcelveldt in [music-assistant#495](music-assistant/models#495)) ## 🙇 Contributors @marcelveldt Co-authored-by: musicassistant-bot[bot] <304008617+musicassistant-bot[bot]@users.noreply.github.com>
balloobbot
pushed a commit
to balloobbot/server
that referenced
this pull request
Nov 27, 2026
…tant#8084) # What does this implement/fix? <!-- Quick description and explanation of changes. --> Sendspin players can now drop a next track they already received and play another one in its place. "Play next", moving, deleting and shuffling then also change the next track on them, up to 5 seconds before it starts. Unless a crossfade into the old next track was already prepared, the switch happens inside the running stream without a gap or restart. Players opt in with the new `replaces_enqueued_media` property on `PlayerProtocol`. Sendspin sets it while "Allow legacy clients" is off and every group member supports the cut, so groups with a bridged Squeezelite or Cast speaker keep the existing lock. The queue publishes the last queue index the player holds as the `PlayerQueue.last_locked_index` field, and the frontend locks the queue up to that index instead of up to the buffered track. A buffered track stays locked while no playable track follows it, since the player can only replace it with one that does. Tested with `sendspin-cli` 1.0.1 (sendspin-cpp v0.10.0) and Python scripts built on the aiosendspin client: "Play next", move, delete and shuffle near the end of a track all switched to the new next track without a gap. **Related issue (if applicable):** - related issue Sendspin/backlog#82 - frontend music-assistant/frontend#3326 - models music-assistant/models#495 ## 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` ## 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. - [x] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [x] 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. --------- Co-authored-by: Marcel van der Veldt <[email protected]>
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.
What does this implement/fix?
Sendspin players can swap the next track they already received (music-assistant/server#8084), so which queue items are locked no longer follows from
index_in_buffer. The server works that out and clients now get the result as one queue field.Changes
PlayerQueue.last_locked_index: the items up to and including this index can't be moved or removed,Nonewhile nothing is locked. Set by the server at runtime, not persisted.Related issue (if applicable):
Types of changes
bugfixnew-featureenhancementbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/serveris linked.