Skip to content

Commit ad6eb43

Browse files
Fix UGP member detection in get_stream (#2617)
1 parent 6cff699 commit ad6eb43

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

music_assistant/controllers/streams.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,8 +877,15 @@ def get_stream(
877877
# because this could have been a group
878878
player_id=media.custom_data["player_id"],
879879
)
880-
elif media.source_id and media.source_id.startswith(UGP_PREFIX):
881-
# special case: UGP stream
880+
elif (
881+
media.media_type == MediaType.FLOW_STREAM
882+
and media.source_id
883+
and media.source_id.startswith(UGP_PREFIX)
884+
and media.uri
885+
and "/ugp/" in media.uri
886+
):
887+
# special case: member player accessing UGP stream
888+
# Check URI to distinguish from the UGP accessing its own stream
882889
ugp_player = cast("UniversalGroupPlayer", self.mass.players.get(media.source_id))
883890
ugp_stream = ugp_player.stream
884891
assert ugp_stream is not None # for type checker

0 commit comments

Comments
 (0)