Fix DLNA player showing external source instead of MA queue (#2648)
authorOzGav <gavnosp@hotmail.com>
Tue, 18 Nov 2025 11:54:47 +0000 (21:54 +1000)
committerGitHub <noreply@github.com>
Tue, 18 Nov 2025 11:54:47 +0000 (12:54 +0100)
music_assistant/providers/dlna/player.py

index 4f956943542e57db3180521f9e603ddbf40270a2..af7a291e45d7d3b88affb65ea5f7e46675323c46 100644 (file)
@@ -219,13 +219,20 @@ class DLNAPlayer(Player):
         _device_uri = self.device.current_track_uri or ""
         self.set_current_media(uri=_device_uri, clear_all=True)
 
-        if "spotify" in _device_uri:
+        # Let player controller determine active source, only override for known external sources
+        if _device_uri and _device_uri.startswith(self.mass.streams.base_url):
+            # MA stream - let controller determine source
+            self._attr_active_source = None
+        elif "spotify" in _device_uri:
+            # Spotify or Spotify Connect
             self._attr_active_source = "spotify"
-        elif _device_uri.startswith("http"):
+        elif _device_uri:
+            # External HTTP source
             self._attr_active_source = "http"
         else:
-            # TODO: extend this list with other possible sources
+            # No URI - idle or unknown
             self._attr_active_source = None
+        # TODO: extend this list with other possible sources
         if self.device.media_position:
             # only update elapsed_time if the device actually reports it
             self._attr_elapsed_time = float(self.device.media_position)