/
/
# What does this implement/fix? When a speaker changes from being one of a universal player's outputs into a regular player of its own (it keeps the same player id), the universal player still lists that speaker as one of its outputs. The replacement then tried to hand the speaker over to itself, which was treated as a refusal and stopped the replacement halfway. The result was a leftover, unusable universal player: its outputs had already moved to the speaker, but the empty universal player stayed behind in the UI and the user's settings (custom name, hidden, etc.) were never carried over to the speaker. Leaving the replacing speaker out of the transfer lets the replacement finish as intended. **Related issue (if applicable):** - follow-up to #5801 ## 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` ## Changes - Skip the replacing speaker itself when moving a universal player's outputs across, so the replacement no longer aborts. - The universal player's settings are now carried over and the leftover empty player is removed. - The speaker is no longer left pointing back at the universal player it replaced, in memory or in its stored settings. - Added tests for these cases, plus a guard test covering why removing an emptied universal player is deliberately left to the flow that owns the takeover. ## 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.