/
/
# What does this implement/fix? Seeking a Spotify track played through the Soloist backend restarted the whole session: the daemon was killed and a fresh one had to spawn, log in, claim the Connect device back and reload the track. Now the session that is already playing the track is simply seeked where it stands. Measured on the test rig, same track and same seek (26s -> 120s): **2.70s -> 1.53s** from the seek to audio being ready, and the Spotify Connect device is no longer taken back off whatever else the account was using. Only seeks that actually reach the provider change: the buffer still serves any position it already holds, so this affects a seek forward past what has been captured, or back beyond an earlier seek. Playback that is merely resumed still starts a fresh session, since the idle session is already gone by then. - Seek the running session in place instead of respawning it, for the item it is already playing - Give the item a fresh audio channel so nothing from before the seek is served, and drop what the capture pipeline still holds when the engine moves - Hold the capture sink while the seek is in flight - Send the seek once: a repeat of one the engine already took restarts the track audibly - Fall back to restarting the session when it cannot take the seek ## 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.