feat: Added a channel selector so we can now use Tidal's staging environment directly from the app

This commit is contained in:
2024-07-15 12:36:55 +02:00
parent 9dc7267a4d
commit 45f8c13c5b
7 changed files with 40 additions and 2 deletions

View File

@@ -29,6 +29,7 @@ const switchesWithSettings = {
let adBlock: HTMLInputElement,
api: HTMLInputElement,
channel: HTMLSelectElement,
customCSS: HTMLInputElement,
disableBackgroundThrottle: HTMLInputElement,
disableHardwareMediaKeys: HTMLInputElement,
@@ -121,6 +122,7 @@ function refreshSettings() {
try {
adBlock.checked = settingsStore.get(settings.adBlock);
api.checked = settingsStore.get(settings.api);
channel.value = settingsStore.get(settings.advanced.tidalUrl);
customCSS.value = settingsStore.get<string, string[]>(settings.customCSS).join("\n");
disableBackgroundThrottle.checked = settingsStore.get(settings.disableBackgroundThrottle);
disableHardwareMediaKeys.checked = settingsStore.get(settings.flags.disableHardwareMediaKeys);
@@ -238,6 +240,7 @@ window.addEventListener("DOMContentLoaded", () => {
adBlock = get("adBlock");
api = get("apiCheckbox");
channel = get<HTMLSelectElement>("channel");
customCSS = get("customCSS");
disableBackgroundThrottle = get("disableBackgroundThrottle");
disableHardwareMediaKeys = get("disableHardwareMediaKeys");
@@ -272,6 +275,7 @@ window.addEventListener("DOMContentLoaded", () => {
refreshSettings();
addInputListener(adBlock, settings.adBlock);
addInputListener(api, settings.api);
addSelectListener(channel, settings.advanced.tidalUrl);
addTextAreaListener(customCSS, settings.customCSS);
addInputListener(disableBackgroundThrottle, settings.disableBackgroundThrottle);
addInputListener(disableHardwareMediaKeys, settings.flags.disableHardwareMediaKeys);

View File

@@ -338,6 +338,20 @@
<input id="updateFrequency" type="number" class="text-input" name="updateFrequency" />
</div>
</div>
<div class="group__option">
<div class="group__description">
<h4>Tidal channel / URL</h4>
<p>
Which URL Tidal Hi-Fi should use.
<strong>note! Beta might break at any time</strong>
</p>
<select class="select-input" id="channel" name="channel">
<option value="https://listen.tidal.com">Stable (listen.tidal.com)</option>
<option value="https://listen.stage.tidal.com">Staging (listen.stage.tidal.com)</option>
</select>
</div>
</div>
</div>
<div class="group">
<p class="group__title">Flags</p>