Skip to content

Commit 487a327

Browse files
committed
Ensure Spotify Connect is passive
1 parent d7767e9 commit 487a327

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

music_assistant/providers/spotify_connect/__init__.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def __init__(
143143
name=self.name,
144144
# we set passive to true because we
145145
# dont allow this source to be selected directly
146-
passive=False,
146+
passive=True,
147147
# Playback control capabilities will be enabled when Spotify Web API is available
148148
can_play_pause=False,
149149
can_seek=False,
@@ -246,7 +246,6 @@ def _update_source_capabilities(self) -> None:
246246
self._source_details.can_play_pause = has_web_api
247247
self._source_details.can_seek = has_web_api
248248
self._source_details.can_next_previous = has_web_api
249-
self._source_details.passive = not has_web_api
250249

251250
# Register or unregister callbacks based on availability
252251
if has_web_api:
@@ -255,30 +254,17 @@ def _update_source_capabilities(self) -> None:
255254
self._source_details.on_next = self._on_next
256255
self._source_details.on_previous = self._on_previous
257256
self._source_details.on_seek = self._on_seek
258-
self._source_details.on_select = self._on_select
259257
else:
260258
self._source_details.on_play = None
261259
self._source_details.on_pause = None
262260
self._source_details.on_next = None
263261
self._source_details.on_previous = None
264262
self._source_details.on_seek = None
265-
self._source_details.on_select = None
266263

267264
# Trigger player update to reflect capability changes
268265
if self._source_details.in_use_by:
269266
self.mass.players.trigger_player_update(self._source_details.in_use_by)
270267

271-
async def _on_select(self) -> None:
272-
"""Handle source selection - transfer Spotify playback to this device."""
273-
if not self._spotify_provider:
274-
return
275-
try:
276-
# Transfer playback to this device when it's selected
277-
await self._ensure_active_device()
278-
await self._spotify_provider._put_data("me/player/play")
279-
except Exception as err:
280-
self.logger.debug("Failed to transfer playback on source selection: %s", err)
281-
282268
async def _on_play(self) -> None:
283269
"""Handle play command via Spotify Web API."""
284270
attached_player = self.mass.players.get(self.mass_player_id)

0 commit comments

Comments
 (0)