/
/
/
# What does this implement/fix? Two methods in the protocol linking code had grown to the point where they sit exactly at the size limit the project enforces, so the next change to either one would have to rewrite it first. This splits them into smaller helpers, each with a single clear job. No behaviour change - purely internal cleanup, in the same spirit as #5672. - Split the per-member grouping logic out of `_translate_members_for_protocols`: each of the grouping methods it tries (child's preferred protocol, the protocol the group is already on, a shared protocol) now lives in its own helper. - Split `_check_merge_universal_players` into finding a merge candidate, deciding which player absorbs the other, and performing the merge. - Added a test for the case where the group's current protocol cannot group members itself and another protocol has to be selected - that path had no coverage. - Corrected the order of the grouping methods listed in the "cannot group" warning. ## 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.