Fix UGP member detection in `get_stream` (#2617)
authorMaxim Raznatovski <nda.mr43@gmail.com>
Mon, 10 Nov 2025 13:39:59 +0000 (14:39 +0100)
committerGitHub <noreply@github.com>
Mon, 10 Nov 2025 13:39:59 +0000 (14:39 +0100)
music_assistant/controllers/streams.py

index 8233a21da7e86dc0c1626cb1277aa8f486e380cc..4a8de858789cb88bdeb6502a2cfaae2611a201b9 100644 (file)
@@ -877,8 +877,15 @@ class StreamsController(CoreController):
                 # because this could have been a group
                 player_id=media.custom_data["player_id"],
             )
-        elif media.source_id and media.source_id.startswith(UGP_PREFIX):
-            # special case: UGP stream
+        elif (
+            media.media_type == MediaType.FLOW_STREAM
+            and media.source_id
+            and media.source_id.startswith(UGP_PREFIX)
+            and media.uri
+            and "/ugp/" in media.uri
+        ):
+            # special case: member player accessing UGP stream
+            # Check URI to distinguish from the UGP accessing its own stream
             ugp_player = cast("UniversalGroupPlayer", self.mass.players.get(media.source_id))
             ugp_stream = ugp_player.stream
             assert ugp_stream is not None  # for type checker