Fix double sendspin bridges for devices with both Airplay and Cast#3854
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to make Sendspin bridge creation/removal for Chromecast devices idempotent when a device supports both Chromecast and AirPlay, with AirPlay preferred and automatic cleanup of redundant/orphaned bridges/config.
Changes:
- Add an idempotent
evaluate_bridgepath for Chromecast Sendspin bridges, including event-driven re-evaluation when relevant players/providers change. - Prefer AirPlay bridges over Cast bridges when both are present under the same universal/parent player (and AirPlay is available).
- Add cleanup logic during universal-player restore to remove orphaned protocol player configs.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| music_assistant/providers/universal_player/provider.py | Adds cleanup for invalid/orphaned linked protocol player configs during universal-player restore. |
| music_assistant/providers/chromecast/sendspin_bridge.py | Introduces _should_have_bridge + evaluate_bridge, adds event subscriptions, and improves bridge removal cleanup. |
| music_assistant/providers/chromecast/provider.py | Switches bridge setup on discovery from setup_bridge to the new evaluate_bridge reconciliation flow. |
Member
|
I think for now this is fine to add like this but if we plan to add more bridges, we should have a generic bridge helper logic in the sendspin provider that can make the decisions per protocol |
marcelveldt
approved these changes
May 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes the bridge evaluation idempotent for devices that both have Airplay and Cast protocols:
So MA can now:
This PR also surfaced the
KeyError: 'player_id'bug which turned out to be a missing guard in thesave_protocol_parent_idfunction.