music-assistant-server

Branch:dev-lidarr-plugin

Commit Details

Crossfade setting changes now apply at the next track on flow mode players (#6143)

# What does this implement/fix?

Flow-mode queues snapshotted the effective crossfade settings once at
stream start, so toggling crossfade (per queue or via the global
default), or changing the global crossfade mode/duration, only took
effect at the next play session instead of the next track. The per-item
stream path already applies changes at the upcoming transition; flow
mode now does the same.

- re-read the effective crossfade mode and duration once per track
iteration in the flow stream generator, instead of reusing the
session-start snapshot
- disabling applies at the very next transition (the held-back tail is
flushed unfaded); enabling applies at the first transition after the
currently playing track, whose tail was never held back
- a flow session that starts on a non-track item no longer keeps
crossfade disabled for later track-to-track transitions
- regression tests for both toggle directions

Notes: a duration increase (or standard-to-smart switch) made mid-track
fades the next transition at the old length and fully applies one
transition later, since the playing track already banked its tail at the
old size. And a non-gapless player playing per-item streams still needs
a new session to pick up an enable, since the switch to flow mode only
happens when the stream URL is resolved.

**Related issue (if applicable):**

- follow-up to the review threads on #6130

## Types of changes

- [x] 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

- [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.
Forgejo

Author

Marvin Schenkel<[email protected]>
September 2, 2026 at 07:07 AM UTC

Committer

Marvin Schenkel<[email protected]>
September 4, 2026 at 07:55 AM UTC
98additions
0deletions
2files changed

Parent commits

Changes

2 files
+98-0

Changed Files (2)

music_assistant/controllers/streams/
tests/controllers/streams/
music_assistant/controllers/streams/audio.py
tests/controllers/streams/test_crossfade_transition.py
+98