Skip to content

Publish the locked part of the queue as one queue field - #8246

Merged
marcelveldt merged 3 commits into
feat/queue-replaceable-next-itemfrom
queue-last-locked-index-field
Nov 27, 2026
Merged

marcelveldt merged 3 commits into
feat/queue-replaceable-next-itemfrom
queue-last-locked-index-field

Conversation

@marcelveldt

@marcelveldt marcelveldt commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

What does this implement/fix?

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 (Add the locked part of the queue to the player queue 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):

Types of changes

  • 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
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

  • The code change is tested and works locally.
  • pre-commit run --all-files passes.
  • 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.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.
  • I have raised a PR against the documentation repository targeting the main or beta branch as appropriate.

The buffered next item only counts as replaceable while an item follows it, so the published lock and every committed_index caller cover a buffered last item.
@marcelveldt

Copy link
Copy Markdown
Member Author

@Bot-MArley review

@Bot-MArley Bot-MArley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Note

This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.

Thanks @marcelveldt! This moves the queue lock from an extra_attributes key to a PlayerQueue.last_locked_index field, folds the "buffered last track stays" rule into committed_index so delete_item and "play next" follow it, and points the MCP queue tools at the same lock. The logic and the API schema bump to 128 look right, the tests cover both the replaceable and the last-track cases, and no migration is needed because the old key never reached a release.

Requested changes

None. One heads-up, not a blocker: the pin is still music-assistant-models==1.1.252, and the field only exists from 1.1.254 (models#495). Until the pin moves, signal_update sets a plain attribute that isn't sent to clients, so make sure 1.1.254 or newer is in place before this lands.

I'm not approving it myself since it changes core code in the queue controller. It's a draft, and lint and test haven't run on this head yet. If you want an approval once it's ready, comment @Bot-MArley approve and I will.

@marcelveldt
marcelveldt marked this pull request as ready for review November 27, 2026 13:59
@marcelveldt
marcelveldt merged commit cbe4b8e into feat/queue-replaceable-next-item Nov 27, 2026
14 checks passed
@marcelveldt
marcelveldt deleted the queue-last-locked-index-field branch November 27, 2026 14:00
@MarvinSchenkel

Copy link
Copy Markdown
Contributor

@Bot-MArley review

@Bot-MArley

Copy link
Copy Markdown
Collaborator

Note

This comment was posted by Bot-MArley on behalf of the Music Assistant maintainers.

@MarvinSchenkel This PR was merged before I got to your review, so there's nothing left to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants