/
/
/
# What does this implement/fix? When a player's state changes, Music Assistant notifies the group players it belongs to so the group can mirror it. That lookup went through the regular "list players" helper, which hides players the current user is not allowed to see and players that are momentarily unavailable. Because the user context of an API command carries into the internal state handling, a state change triggered by a non-admin user (or by an automation impersonating one) could skip the group player entirely, leaving the group showing stale playback state. This became easier to hit after #5385 routed the sync leader mirroring through the same path. The lookup is internal bookkeeping and now reads the player registry directly. **Related issue (if applicable):** - n/a (found while reviewing #5385) ## 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 - Look up a player's group players directly in the player registry instead of through the user-facing player list, so the internal state fan-out is never narrowed by whoever triggered it. - Also notify group players that are currently unavailable — a group mirrors its members, so skipping it there is exactly when its state goes stale. Disabled players and players still being registered are still skipped. - Dropped two parameters that no caller ever set. - Added regression tests covering the restricted-user case, the unavailable case, and the two remaining guards. ## 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.