Fix: correctly detect pluginsource is in use
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 24 Feb 2025 19:57:36 +0000 (20:57 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 24 Feb 2025 19:57:36 +0000 (20:57 +0100)
music_assistant/controllers/players.py

index 658a81f9452f3baf8d676add08f93e4c4cca8310..88d8af65a0e8d61b1f1411d41dcc9978bd3604c3 100644 (file)
@@ -1404,10 +1404,9 @@ class PlayerController(CoreController):
             return self._get_active_source(group_player)
         # if player has plugin source active return that
         for plugin_source in self._get_plugin_sources():
-            if player.active_source == plugin_source.id or (
-                player.current_media
-                and plugin_source.id == player.current_media.queue_id
-                and player.state in (PlayerState.PLAYING, PlayerState.PAUSED)
+            if (
+                player.active_source == plugin_source.id
+                or plugin_source.in_use_by == player.player_id
             ):
                 # copy/set current media if available
                 if plugin_source.metadata: