Skip to content

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

Merged
marcelveldt merged 2 commits into
devfrom
queue-crossfade-available
Dec 2, 2026
Merged

marcelveldt merged 2 commits into
devfrom
queue-crossfade-available

Conversation

@marcelveldt

Copy link
Copy Markdown
Member

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

  • 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

@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 publishes a new crossfade_available field on the queue, worked out with the same check that refuses switching crossfade on, and refreshes it on player updates and saved player configs. It isn't written to the queue cache, and the README and tests cover it. The logic looks right to me. One thing is missing before this can merge:

Requested changes

  1. [PROBLEM] crossfade_available is a new model field that now goes out to every client with each queue update, but API_SCHEMA_VERSION is still 129. The comment above it asks for a bump for exactly this case, so clients that ship separately (the HA integration, the companion apps) can tell which servers fill the field. Please bump it to 130 (inline at controller.py#L4264).

@marcelveldt

Copy link
Copy Markdown
Member Author

@Bot-MArley review again

@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 publishes crossfade_available on the queue, worked out with the same check that refuses switching crossfade on, and keeps it current on player updates and saved player configs. It isn't stored with the cached queue, and the models pin on dev (1.1.257) already includes the field.

The API_SCHEMA_VERSION bump to 130 that I asked for last time is in now, so that point is fixed (the old conversation still needs resolving by hand). It merges cleanly onto the latest dev, and nothing else stood out: it looks good to me. It changes core code in the player queues controller, so I don't approve it on my own; comment @Bot-MArley approve and I will.

@marcelveldt

Copy link
Copy Markdown
Member Author

Lab gate --areas queue is green on cb1ecaf (run 20261202-224916-6a8b): all 6 passed on the first try, on the squeezelite, AirPlay, DLNA, Snapcast and Sendspin roles.

@marcelveldt
marcelveldt marked this pull request as ready for review December 2, 2026 22:58
@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 Noted for cb1ecaf: I'll approve it in a few minutes if my review of this commit is clean, and review it first if I haven't. Dependency changes and new providers still need a maintainer's approval. To have it merged, say @Bot-MArley merge. After a new push, ask again.

@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, looks good to me 🙌 Approved at your request: the review found no open points, the schema bump is in, CI is green, and the lab gate passed.

@marcelveldt
marcelveldt added this pull request to the merge queue Dec 2, 2026
Merged via the queue into dev with commit 4d2aa34 Dec 2, 2026
26 checks passed
@marcelveldt
marcelveldt deleted the queue-crossfade-available branch December 2, 2026 23:14
OzGav added a commit to music-assistant/music-assistant.io that referenced this pull request Dec 4, 2026
…d Sonos bit depth (#1352)

<!--
Thanks for contributing. The checklist below is short but the build
enforces most
of it, so ticking it off saves a round trip.

Full guide:
https://github.com/music-assistant/music-assistant.io/blob/beta/CONTRIBUTING.md
-->

## What does this change?

A continuous stream now plays in the sample rate of its first track, so
the "Flow mode sample rate" setting and the Sendspin "Sample rate
selection" are gone from the pages (music-assistant/server#8453). The
crossfade button in the Now Playing view is greyed out with the reason
when the player's playback method cannot crossfade
(music-assistant/server#8455, music-assistant/frontend#3404). An MPD
player can play track by track (music-assistant/server#8462), and the
Sonos page says in which bit depth each lossless level plays
(music-assistant/server#8466). The new default playback quality of
music-assistant/server#8459 needs no change, as no page named the old
one. Builds on #1349.

- Individual player settings: removed the "Flow mode sample rate"
section, the "Continuous stream" row matches the option text, and the
playback method section says which sample rate a stream plays in
- Sendspin and Samsung WAM: describe the sample rate a stream plays in
instead of the removed setting
- Now Playing view and playback method: the crossfade button is greyed
out with the reason
- MPD: **Track by track, started by Music Assistant** next to
**Continuous stream**
- Sonos: which playback quality to pick for hi-res music

## Checklist

- [x] Correct branch: `main` if this fixes something already on the live
site, `beta` if it adds anything new
- [ ] Any new page has a sidebar entry in `astro.config.mjs`, except
music sources and player providers

### Only if you are adding a music source or a player provider

<!-- Plugins, metadata providers and audio analysis providers do not
need these. -->

- [ ] File named after the source or provider, since the menu is sorted
by filename
- [ ] Icon added to `public/assets/icons/`, and it is visible against a
white background
- [ ] Entry added to `src/data/music-sources.ts` or
`src/data/players.ts`, with categories

---

Once this is open, scroll down to the checks and wait for **Deploy
Preview**. If it is green,
click the link to see your change on the site. If it is red, click
`Details`, read the error at
the bottom of the log and push a fix to the same branch. There is no
need to open a new pull
request.
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.

2 participants