/
/
# What does this implement/fix? Volume normalization can use either a track's own loudness or the loudness measured over its whole album. Until now the server guessed which one applied by looking at the queue: a track got album loudness when the item right before or after it happened to be from the same album. That guessed wrong both ways. A shuffled playlist that happens to put two tracks of one album next to each other applied album loudness to those two and track loudness to everything around them — an audible level step in the middle of a playlist. And an album played on shuffle got track loudness for most of it, because its neighbours only lined up by luck. The queue already records which album, playlist or track the user actually pressed play on, and that survives a restart. Album loudness now follows that instead — the same signal the album play-credit already uses. - Album loudness is used when the track belongs to an album the user enqueued, whatever order the queue plays it in - Tracks from a playlist, a radio/dynamic source or an autoplay fill now consistently use track loudness - On a mixed queue (an album plus separately added tracks) only the album's own tracks get album loudness - A track repeating on its own keeps using track loudness, as before - Also fixed: enqueueing without an explicit option ignored the configured default of *add* or *play next* — it wiped the "what did the user play" list, and expanded items into a smart-mix queue instead of feeding the mix Note: playing a folder straight from the browse view never records an album, so those plays now use track loudness. **Related issue (if applicable):** - follow-up on #5981 ## Types of changes - [ ] 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. - [ ] 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.