/
/
# What does this implement/fix? When an Apple TV (or HomePod) loses its device control connection, Music Assistant kept showing whatever it last saw playing on the device. Since a paused tvOS app is deliberately shown as "paused" (many apps report idle instead), the player would stay stuck on e.g. "Netflix - paused" until it reconnected or was powered off. While stuck that way, pressing play tried to resume that app instead of the Music Assistant queue, so the queue could not be started from the player anymore. The externally observed playback state is now cleared as soon as the connection that provided it is gone, so the player falls back to the Music Assistant queue. State owned by an active Music Assistant stream is left untouched. **Related issue (if applicable):** - n/a ## 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` Changes: - Clear the external playback state, source and media when the playback monitoring connection closes or its updates fail - Keep the state as-is while Music Assistant is streaming to the device - Reuse the existing `mark_external_source_ended` handling for this - Added tests ## 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.