From c06890426cd71862b657462cb50d0f138094888c Mon Sep 17 00:00:00 2001 From: Stephane Bouvard Date: Fri, 8 Aug 2025 10:32:06 +0200 Subject: [PATCH] Updates --- modules/apple-music/apple-music.js | 17 +++++++++++++---- websocket-streamerbot.cs | 4 ++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/modules/apple-music/apple-music.js b/modules/apple-music/apple-music.js index 1c936c2..917c15a 100644 --- a/modules/apple-music/apple-music.js +++ b/modules/apple-music/apple-music.js @@ -100,6 +100,10 @@ visibilityDuration = data.param1 || visibilityDefault; showSongInfo(); }); + SBdispatcher.on('musicPlaying-hide', data => { + visibilityDuration = -1; + SetVisibility(false); + }); } function connectws() { @@ -123,6 +127,9 @@ // Song changes case ("playbackStatus.nowPlayingItemDidChange"): UpdateSongInfo(data); + if (visibilityDuration != "-1") { + showSongInfo(); + } break; // Progress bar moves @@ -149,6 +156,12 @@ SetVisibility(false); }, visibilityDuration * 1000); } + + if (visibilityDuration == "-1") { + setTimeout(() => { + SetVisibility(false); + }, visibilityDefault * 1000); + } } function UpdateSongInfo(data) { @@ -169,9 +182,6 @@ document.getElementById("albumArtBack").src = albumArtUrl; document.getElementById("backgroundImageBack").src = albumArtUrl; }, 2 * animationSpeed * 500); - - showSongInfo() - } function UpdateTextLabel(div, text) { @@ -204,7 +214,6 @@ } function UpdatePlaybackState(data) { - console.log(data); switch (data.state) { case ("paused"): case ("stopped"): diff --git a/websocket-streamerbot.cs b/websocket-streamerbot.cs index d180943..da4da1b 100644 --- a/websocket-streamerbot.cs +++ b/websocket-streamerbot.cs @@ -23,6 +23,10 @@ public class CPHInline if (args.ContainsKey("wsParam3")) message.Add("param3",args["wsParam3"]); if (args.ContainsKey("wsParam4")) message.Add("param4",args["wsParam4"]); if (args.ContainsKey("wsParam5")) message.Add("param5",args["wsParam5"]); + if (args.ContainsKey("wsParam6")) message.Add("param6",args["wsParam6"]); + if (args.ContainsKey("wsParam7")) message.Add("param7",args["wsParam7"]); + if (args.ContainsKey("wsParam8")) message.Add("param8",args["wsParam8"]); + if (args.ContainsKey("wsParam9")) message.Add("param9",args["wsParam9"]); var jsonMessage = JsonConvert.SerializeObject(message); CPH.WebsocketBroadcastJson(jsonMessage);