Skip to content

Tell clients whether crossfade can be switched on for a queue - #506

Merged
marcelveldt merged 1 commit into
mainfrom
queue-crossfade-available
Dec 2, 2026
Merged

marcelveldt merged 1 commit into
mainfrom
queue-crossfade-available

Conversation

@marcelveldt

Copy link
Copy Markdown
Member

What does this implement/fix?

The queue now tells clients whether crossfade can be switched on with the playback method of its player, for example not on a speaker that plays track by track without gapless support. Clients need this to show the crossfade button as unavailable instead of letting the user press it and get an error; the server side follows in music-assistant/server and the button in music-assistant/frontend.

  • New read-only PlayerQueue.crossfade_available field (defaults to True, so older servers and clients keep working)

Related issue (if applicable):

  • related issue

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
  • 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.
  • Any consumer of a changed model is updated, and the companion PR in music-assistant/server is linked.
  • I have read and complied with the project's AI Policy for any AI-assisted contributions.

@github-actions github-actions Bot added the enhancement Enhancement of an existing feature/functionality label Dec 2, 2026
@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 adds a read-only crossfade_available flag to PlayerQueue so clients can show the crossfade toggle as unavailable instead of letting users hit an error. The field sits with the other runtime-derived flags, and its comment follows theirs. Defaulting to True keeps the current behaviour when an older server leaves the key out. The new tests only add cases and leave the existing ones alone.

No requested changes, this looks good. One small thing: the companion music-assistant/server PR isn't linked yet. Once it's linked and this is out of draft, it's ready for a maintainer to merge.

@marcelveldt
marcelveldt marked this pull request as ready for review December 2, 2026 20:47
@marcelveldt

Copy link
Copy Markdown
Member Author

@Bot-MArley approve

@Bot-MArley

Copy link
Copy Markdown
Collaborator

Note

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

@marcelveldt approve only works on your own server PRs into dev. On someone else's PR, approve it yourself.

@marcelveldt
marcelveldt merged commit 98e57bc into main Dec 2, 2026
11 checks passed
@marcelveldt
marcelveldt deleted the queue-crossfade-available branch December 2, 2026 20:56
n-gras pushed a commit to n-gras/server that referenced this pull request Dec 2, 2026
Update music-assistant-models to version
[1.1.257](https://github.com/music-assistant/models/releases/tag/1.1.257)


## 🚀 Features and enhancements

- Tell clients whether crossfade can be switched on for a queue (by
@marcelveldt in
[music-assistant#506](music-assistant/models#506))

## 🧰 Maintenance and dependency bumps

- Document the multiline format of a string config entry (by
@marcelveldt in
[music-assistant#505](music-assistant/models#505))
- Let config actions mark themselves as destructive (by @marcelveldt in
[music-assistant#504](music-assistant/models#504))


## 🙇 Contributors

@marcelveldt

Co-authored-by: musicassistant-bot[bot] <304008617+musicassistant-bot[bot]@users.noreply.github.com>
trudenboy pushed a commit to trudenboy/ma-server that referenced this pull request Dec 3, 2026
…assistant#8455)

# What does this implement/fix?

The server now tells clients whether crossfade can be switched on for a
queue, so they can show the crossfade button as unavailable instead of
showing an error after it is pressed. The button itself follows in the
frontend.

- New queue field `crossfade_available`, set by the same rule that
refuses switching crossfade on (one shared check)
- Refreshed on every update of the queue's player and whenever a player
config is saved, so a changed playback method (also of a group's leader)
is published right away
- Derived at runtime and not stored with the cached queue

**Related issue (if applicable):**

- none

## 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. (music-assistant/models#506)
- [ ] 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement of an existing feature/functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants