/
/
/
# What does this implement/fix? A DLNA player could report a playback position that ran ahead of the audio, which since #5461 also propagates to any universal group it plays in. A DLNA device never sends its position as an event, and the underlying library only re-stamps a position that actually changed. Two things went wrong with that: - When a device reported that it started or resumed playing, the position refresh and the state update were kicked off at the same time, so the state update read the position from before the refresh had landed — the position of whatever played last, timestamped minutes or hours earlier. - Right after a resume the device still reports the same position it had when it was paused, so the timestamp that comes with it still dates from the start of the pause. The whole paused period was then counted as playback time. Resuming after a longer pause could therefore report a position far past the real one, which can make the queue skip the rest of the track. **Related issue (if applicable):** - follow-up to #5469 ## Changes - Refresh the device state before reporting a start or resume, instead of alongside it. - Never anchor a position earlier than the moment playback started. - Tests for both cases. ## 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` - [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. - [ ] 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.