Spotify Connect: Fix UI not updating when MA starts playing an item (#2705)
authorMarvin Schenkel <marvinschenkel@gmail.com>
Fri, 28 Nov 2025 18:23:06 +0000 (19:23 +0100)
committerGitHub <noreply@github.com>
Fri, 28 Nov 2025 18:23:06 +0000 (19:23 +0100)
music_assistant/providers/spotify_connect/__init__.py

index 1dcac43cd738c0bb64451a134a993be07d644f67..c81c0fd4b1fdf2e4b78fd284363a484dc17f2660 100644 (file)
@@ -558,6 +558,13 @@ class SpotifyConnectProvider(PluginProvider):
                 self._spotify_provider = None
                 self._update_source_capabilities()
 
+        # handle paused event - clear in_use_by so UI shows correct active source
+        # this happens when MA starts playing while Spotify Connect was active
+        if event_name == "paused" and self._source_details.in_use_by:
+            self.logger.debug("Spotify Connect paused, releasing player %s", self.mass_player_id)
+            self._source_details.in_use_by = None
+            self.mass.players.trigger_player_update(self.mass_player_id)
+
         # handle session connected event
         # this player has become the active spotify connect player
         # we need to start the playback