Skip to content

Commit

Permalink
Fix: PluginSource playback to group player
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Feb 22, 2025
1 parent a60000d commit c6b2cb0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
5 changes: 3 additions & 2 deletions music_assistant/controllers/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -1643,9 +1643,10 @@ async def _handle_select_plugin_source(
uri=stream_url,
media_type=MediaType.PLUGIN_SOURCE,
title=plugin_source.name,
queue_id=plugin_source.id,
custom_data={
"provider": plugin_source.id,
"provider": plugin_prov.instance_id,
"source_id": plugin_source.id,
"player_id": player.player_id,
"audio_format": plugin_source.audio_format,
},
),
Expand Down
6 changes: 4 additions & 2 deletions music_assistant/providers/airplay/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,11 @@ async def play_media(
input_format = AIRPLAY_PCM_FORMAT
assert media.custom_data
audio_source = self.mass.streams.get_plugin_source_stream(
plugin_source_id=media.custom_data["provider"],
plugin_source_id=media.custom_data["source_id"],
output_format=AIRPLAY_PCM_FORMAT,
player_id=player_id,
# need to pass player_id from the PlayerMedia object
# because this could have been a group
player_id=media.custom_data["player_id"],
)
elif media.queue_id and media.queue_id.startswith("ugp_"):
# special case: UGP stream
Expand Down
4 changes: 2 additions & 2 deletions music_assistant/providers/player_group/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,9 @@ async def play_media(
elif media.media_type == MediaType.PLUGIN_SOURCE:
# special case: plugin source stream
audio_source = self.mass.streams.get_plugin_source_stream(
plugin_source_id=media.custom_data["provider"],
plugin_source_id=media.custom_data["source_id"],
output_format=UGP_FORMAT,
player_id=player_id,
player_id=media.custom_data["player_id"],
)
elif media.media_type == MediaType.RADIO:
# use single item stream request for radio streams
Expand Down
6 changes: 4 additions & 2 deletions music_assistant/providers/slimproto/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,11 @@ async def play_media(
elif media.media_type == MediaType.PLUGIN_SOURCE:
# special case: plugin source stream
audio_source = self.mass.streams.get_plugin_source_stream(
plugin_source_id=media.custom_data["provider"],
plugin_source_id=media.custom_data["source_id"],
output_format=master_audio_format,
player_id=player_id,
# need to pass player_id from the PlayerMedia object
# because this could have been a group
player_id=media.custom_data["player_id"],
)
elif media.queue_id.startswith("ugp_"):
# special case: UGP stream
Expand Down

0 comments on commit c6b2cb0

Please sign in to comment.