mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-22 13:32:42 +01:00
Hide/Show ListenBrainz settings
This commit is contained in:
parent
d81912db0c
commit
e9434cc5ea
@ -8,7 +8,7 @@ const ListenBrainzStore = new Store({name: "listenbrainz"});
|
|||||||
|
|
||||||
export class ListenBrainz {
|
export class ListenBrainz {
|
||||||
/**
|
/**
|
||||||
* Call the ListenBrainz API and create playing now payload
|
* Call the ListenBrainz API and create playing now payload and scrobble old song
|
||||||
* @param title
|
* @param title
|
||||||
* @param artists
|
* @param artists
|
||||||
* @param status
|
* @param status
|
||||||
|
@ -144,6 +144,10 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
} else {
|
} else {
|
||||||
settingsStore.set(key, source.value);
|
settingsStore.set(key, source.value);
|
||||||
}
|
}
|
||||||
|
// Live update the view for ListenBrainz input, hide if disabled/show if enabled
|
||||||
|
if (source.value === "on" && source.id === "enableListenBrainz") {
|
||||||
|
source.checked ? document.getElementById("listenbrainz__options").hidden = false : document.getElementById("listenbrainz__options").hidden = true;
|
||||||
|
}
|
||||||
ipcRenderer.send(globalEvents.storeChanged);
|
ipcRenderer.send(globalEvents.storeChanged);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -195,6 +199,7 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
ListenBrainzToken = get("ListenBrainzToken");
|
ListenBrainzToken = get("ListenBrainzToken");
|
||||||
|
|
||||||
refreshSettings();
|
refreshSettings();
|
||||||
|
enableListenBrainz.checked ? document.getElementById("listenbrainz__options").hidden = false : document.getElementById("listenbrainz__options").hidden = true;
|
||||||
|
|
||||||
addInputListener(adBlock, settings.adBlock);
|
addInputListener(adBlock, settings.adBlock);
|
||||||
addInputListener(api, settings.api);
|
addInputListener(api, settings.api);
|
||||||
|
@ -221,20 +221,22 @@
|
|||||||
<span class="switch__slider"></span>
|
<span class="switch__slider"></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="group__option">
|
<div id="listenbrainz__options" hidden="true">
|
||||||
<div class="group__description">
|
<div class="group__option">
|
||||||
<h4>ListenBrainz API Url</h4>
|
<div class="group__description">
|
||||||
<p>There are multiple instances for ListenBrainz you can set the corresponding API url below.</p>
|
<h4>ListenBrainz API Url</h4>
|
||||||
|
<p>There are multiple instances for ListenBrainz you can set the corresponding API url below.</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<textarea id="ListenBrainzAPI" class="textarea" cols="1" rows="1" spellcheck="false"></textarea>
|
||||||
<textarea id="ListenBrainzAPI" class="textarea" cols="1" rows="1" spellcheck="false"></textarea>
|
<div class="group__option">
|
||||||
<div class="group__option">
|
<div class="group__description">
|
||||||
<div class="group__description">
|
<h4>ListenBrainz User Token</h4>
|
||||||
<h4>ListenBrainz User Token</h4>
|
<p>Provide the user token you can get from the settings page.</p>
|
||||||
<p>Provide the user token you can get from the settings page.</p>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<textarea id="ListenBrainzToken" class="textarea" cols="1" rows="1" spellcheck="false"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<textarea id="ListenBrainzToken" class="textarea" cols="1" rows="1" spellcheck="false"></textarea>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user