mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-22 21:42:46 +01:00
staticWindowTitle(fix): Order alphabetically on all appearances, change if to a ternary
This commit is contained in:
parent
cb8667bd41
commit
974877ea4f
@ -55,9 +55,9 @@ export const settings = {
|
|||||||
singleInstance: "singleInstance",
|
singleInstance: "singleInstance",
|
||||||
skipArtists: "skipArtists",
|
skipArtists: "skipArtists",
|
||||||
skippedArtists: "skippedArtists",
|
skippedArtists: "skippedArtists",
|
||||||
|
staticWindowTitle: "staticWindowTitle",
|
||||||
theme: "theme",
|
theme: "theme",
|
||||||
trayIcon: "trayIcon",
|
trayIcon: "trayIcon",
|
||||||
staticWindowTitle: "staticWindowTitle",
|
|
||||||
updateFrequency: "updateFrequency",
|
updateFrequency: "updateFrequency",
|
||||||
windowBounds: {
|
windowBounds: {
|
||||||
root: "windowBounds",
|
root: "windowBounds",
|
||||||
|
@ -46,9 +46,9 @@ let adBlock: HTMLInputElement,
|
|||||||
singleInstance: HTMLInputElement,
|
singleInstance: HTMLInputElement,
|
||||||
skipArtists: HTMLInputElement,
|
skipArtists: HTMLInputElement,
|
||||||
skippedArtists: HTMLInputElement,
|
skippedArtists: HTMLInputElement,
|
||||||
|
staticWindowTitle: HTMLInputElement,
|
||||||
theme: HTMLSelectElement,
|
theme: HTMLSelectElement,
|
||||||
trayIcon: HTMLInputElement,
|
trayIcon: HTMLInputElement,
|
||||||
staticWindowTitle: HTMLInputElement,
|
|
||||||
updateFrequency: HTMLInputElement,
|
updateFrequency: HTMLInputElement,
|
||||||
enableListenBrainz: HTMLInputElement,
|
enableListenBrainz: HTMLInputElement,
|
||||||
ListenBrainzAPI: HTMLInputElement,
|
ListenBrainzAPI: HTMLInputElement,
|
||||||
@ -141,10 +141,10 @@ function refreshSettings() {
|
|||||||
port.value = settingsStore.get(settings.apiSettings.port);
|
port.value = settingsStore.get(settings.apiSettings.port);
|
||||||
singleInstance.checked = settingsStore.get(settings.singleInstance);
|
singleInstance.checked = settingsStore.get(settings.singleInstance);
|
||||||
skipArtists.checked = settingsStore.get(settings.skipArtists);
|
skipArtists.checked = settingsStore.get(settings.skipArtists);
|
||||||
theme.value = settingsStore.get(settings.theme);
|
|
||||||
skippedArtists.value = settingsStore.get<string, string[]>(settings.skippedArtists).join("\n");
|
skippedArtists.value = settingsStore.get<string, string[]>(settings.skippedArtists).join("\n");
|
||||||
trayIcon.checked = settingsStore.get(settings.trayIcon);
|
|
||||||
staticWindowTitle.checked = settingsStore.get(settings.staticWindowTitle);
|
staticWindowTitle.checked = settingsStore.get(settings.staticWindowTitle);
|
||||||
|
theme.value = settingsStore.get(settings.theme);
|
||||||
|
trayIcon.checked = settingsStore.get(settings.trayIcon);
|
||||||
updateFrequency.value = settingsStore.get(settings.updateFrequency);
|
updateFrequency.value = settingsStore.get(settings.updateFrequency);
|
||||||
enableListenBrainz.checked = settingsStore.get(settings.ListenBrainz.enabled);
|
enableListenBrainz.checked = settingsStore.get(settings.ListenBrainz.enabled);
|
||||||
ListenBrainzAPI.value = settingsStore.get(settings.ListenBrainz.api);
|
ListenBrainzAPI.value = settingsStore.get(settings.ListenBrainz.api);
|
||||||
@ -261,9 +261,9 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
port = get("port");
|
port = get("port");
|
||||||
theme = get<HTMLSelectElement>("themesList");
|
theme = get<HTMLSelectElement>("themesList");
|
||||||
trayIcon = get("trayIcon");
|
trayIcon = get("trayIcon");
|
||||||
staticWindowTitle = get("staticWindowTitle");
|
|
||||||
skipArtists = get("skipArtists");
|
skipArtists = get("skipArtists");
|
||||||
skippedArtists = get("skippedArtists");
|
skippedArtists = get("skippedArtists");
|
||||||
|
staticWindowTitle = get("staticWindowTitle");
|
||||||
singleInstance = get("singleInstance");
|
singleInstance = get("singleInstance");
|
||||||
updateFrequency = get("updateFrequency");
|
updateFrequency = get("updateFrequency");
|
||||||
enableListenBrainz = get("enableListenBrainz");
|
enableListenBrainz = get("enableListenBrainz");
|
||||||
@ -298,10 +298,10 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||||||
addInputListener(port, settings.apiSettings.port);
|
addInputListener(port, settings.apiSettings.port);
|
||||||
addInputListener(skipArtists, settings.skipArtists);
|
addInputListener(skipArtists, settings.skipArtists);
|
||||||
addTextAreaListener(skippedArtists, settings.skippedArtists);
|
addTextAreaListener(skippedArtists, settings.skippedArtists);
|
||||||
|
addInputListener(staticWindowTitle, settings.staticWindowTitle);
|
||||||
addInputListener(singleInstance, settings.singleInstance);
|
addInputListener(singleInstance, settings.singleInstance);
|
||||||
addSelectListener(theme, settings.theme);
|
addSelectListener(theme, settings.theme);
|
||||||
addInputListener(trayIcon, settings.trayIcon);
|
addInputListener(trayIcon, settings.trayIcon);
|
||||||
addInputListener(staticWindowTitle, settings.staticWindowTitle);
|
|
||||||
addInputListener(updateFrequency, settings.updateFrequency);
|
addInputListener(updateFrequency, settings.updateFrequency);
|
||||||
addInputListener(
|
addInputListener(
|
||||||
enableListenBrainz,
|
enableListenBrainz,
|
||||||
|
@ -595,8 +595,7 @@ setInterval(function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// update title, url and play info with new info
|
// update title, url and play info with new info
|
||||||
if(settingsStore.get(settings.staticWindowTitle)) setTitle(staticTitle)
|
settingsStore.get(settings.staticWindowTitle) ? setTitle(staticTitle) : setTitle(songDashArtistTitle);
|
||||||
else setTitle(songDashArtistTitle);
|
|
||||||
getTrackURL();
|
getTrackURL();
|
||||||
currentSong = songDashArtistTitle;
|
currentSong = songDashArtistTitle;
|
||||||
currentPlayStatus = currentStatus;
|
currentPlayStatus = currentStatus;
|
||||||
|
@ -69,9 +69,9 @@ export const settingsStore = new Store({
|
|||||||
singleInstance: true,
|
singleInstance: true,
|
||||||
skipArtists: false,
|
skipArtists: false,
|
||||||
skippedArtists: [""],
|
skippedArtists: [""],
|
||||||
|
staticWindowTitle: false,
|
||||||
theme: "none",
|
theme: "none",
|
||||||
trayIcon: true,
|
trayIcon: true,
|
||||||
staticWindowTitle: false,
|
|
||||||
updateFrequency: 500,
|
updateFrequency: 500,
|
||||||
windowBounds: { width: 800, height: 600 },
|
windowBounds: { width: 800, height: 600 },
|
||||||
},
|
},
|
||||||
@ -128,7 +128,7 @@ const settingsModule = {
|
|||||||
settingsWindow,
|
settingsWindow,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const createSettingsWindow = function() {
|
export const createSettingsWindow = function () {
|
||||||
settingsWindow = new BrowserWindow({
|
settingsWindow = new BrowserWindow({
|
||||||
width: 650,
|
width: 650,
|
||||||
height: 700,
|
height: 700,
|
||||||
@ -160,7 +160,7 @@ export const createSettingsWindow = function() {
|
|||||||
settingsModule.settingsWindow = settingsWindow;
|
settingsModule.settingsWindow = settingsWindow;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const showSettingsWindow = function(tab = "general") {
|
export const showSettingsWindow = function (tab = "general") {
|
||||||
if (!settingsWindow) {
|
if (!settingsWindow) {
|
||||||
console.log("Settings window is not initialized. Attempting to create it.");
|
console.log("Settings window is not initialized. Attempting to create it.");
|
||||||
createSettingsWindow();
|
createSettingsWindow();
|
||||||
@ -171,11 +171,11 @@ export const showSettingsWindow = function(tab = "general") {
|
|||||||
settingsWindow.webContents.send("refreshData");
|
settingsWindow.webContents.send("refreshData");
|
||||||
settingsWindow.show();
|
settingsWindow.show();
|
||||||
};
|
};
|
||||||
export const hideSettingsWindow = function() {
|
export const hideSettingsWindow = function () {
|
||||||
settingsWindow.hide();
|
settingsWindow.hide();
|
||||||
};
|
};
|
||||||
|
|
||||||
export const closeSettingsWindow = function() {
|
export const closeSettingsWindow = function () {
|
||||||
settingsWindow = null;
|
settingsWindow = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user