From 9c93e3dafdbc2858ce577ca5ca7d3e128c56e97a Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 16 Oct 2023 18:33:01 -0400 Subject: [PATCH] fix(ags player): make sure players are init correctly --- hosts/wim/config/ags/js/media-player/player.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hosts/wim/config/ags/js/media-player/player.js b/hosts/wim/config/ags/js/media-player/player.js index 3a752ec9..8ad8d8b2 100644 --- a/hosts/wim/config/ags/js/media-player/player.js +++ b/hosts/wim/config/ags/js/media-player/player.js @@ -93,9 +93,17 @@ export default () => Box({ ], connections: [ [Mpris, (overlay, busName) => { - if (!busName || overlay._players.has(busName)) + if (overlay._players.has(busName)) return; + if (!busName) { + let player = Mpris.players.find(p => !overlay._players.has(p.busName)); + if (player) + busName = player.busName; + else + return; + } + const player = Mpris.getPlayer(busName); player.colors = Variable(); overlay._players.set(busName, PlayerBox(player));