From 8202876ae5bf29e6927c480c3c1b6bb4a918b678 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 16 Feb 2024 16:14:07 +0100 Subject: [PATCH] . --- .idea/dataSources.local.xml | 2 +- .idea/workspace.xml | 10 ++++++---- scripts/lib/squeezebox.php | 20 +++++++++++++++----- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml index f350727..ad38e4f 100644 --- a/.idea/dataSources.local.xml +++ b/.idea/dataSources.local.xml @@ -1,6 +1,6 @@ - + " diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1a3996c..1fe400e 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,8 +5,9 @@ + - + - + diff --git a/scripts/lib/squeezebox.php b/scripts/lib/squeezebox.php index a33f5d3..b836749 100644 --- a/scripts/lib/squeezebox.php +++ b/scripts/lib/squeezebox.php @@ -134,18 +134,28 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr return; } + $currentMusicKey = 'squeezeplaybyname_' . $player; + $currentMusic = getState($currentMusicKey, ''); + + global $allmusics; $m = $allmusics[$musicName]; - $player = _player($player); - $player = _squeezePlay($player, $volume); squeezeRequest('pause', $player); - foreach ($m['commands'] as $command) { - echo $player . ':' . $command . '
'; - squeezeRequest($command, $player); + if ($currentMusic !== $musicName) { + setState($currentMusicKey, $musicName); + foreach ($m['commands'] as $command) { + echo $player . ':' . $command . '
'; + squeezeRequest($command, $player); + } + } else { + squeezeRequest('button jump_fwd', $player); } + $player = _player($player); + $player = _squeezePlay($player, $volume); + if ($player === 'Salle de bains' || $player == $squeezeboxPlayers['Salle de bains']) { hotwaterCheckMode(); sleep(3); -- 2.39.5