From 9a55a6ec39314372dc06179630d726d455923070 Mon Sep 17 00:00:00 2001 From: Matt Walsh Date: Fri, 6 Jun 2025 16:40:08 -0500 Subject: [PATCH] fix setting boolean-style query string parsing close #106 --- README.md | 5 +++++ server/scripts/modules/utils/setting.mjs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 54b4db8..64f3218 100644 --- a/README.md +++ b/README.md @@ -139,6 +139,11 @@ Ws4kp is muted by default, but if it was unmuted on the last visit it is coded t Chrome seems to be more lenient on auto play and will eventually let a site auto-play music if you're visited it enough recently and manually clicked to start playing music on each visit. It also has a flag you can add to the command line when launching Chrome: `chrome.exe --autoplay-policy=no-user-gesture-required`. This is the best solution when using Kiosk-style setup. +If you're unable to pre-set the play state before entering kiosk mode (such as with a home dashboard implemenation) you can add the query string value below to the url. The browser will still follow the auto play rules outlined above. +``` +?settings-mediaPlaying-boolean=true +``` + ## Community Notes Thanks to the WeatherStar community for providing these discussions to further extend your retro forecasts! diff --git a/server/scripts/modules/utils/setting.mjs b/server/scripts/modules/utils/setting.mjs index 4588ed8..2bfe853 100644 --- a/server/scripts/modules/utils/setting.mjs +++ b/server/scripts/modules/utils/setting.mjs @@ -38,6 +38,9 @@ class Setting { if (this.type === 'checkbox' && urlValue !== undefined) { urlState = urlValue === 'true'; } + if (this.type === 'boolean' && urlValue !== undefined) { + urlState = urlValue === 'true'; + } if (this.type === 'select' && urlValue !== undefined) { urlState = parseFloat(urlValue); }