diff --git a/.sass-cache/80ae838cce63531149daf490f23e4fe5c65c681b/settings.scssc b/.sass-cache/80ae838cce63531149daf490f23e4fe5c65c681b/settings.scssc new file mode 100644 index 0000000..bb40a1c Binary files /dev/null and b/.sass-cache/80ae838cce63531149daf490f23e4fe5c65c681b/settings.scssc differ diff --git a/package-lock.json b/package-lock.json index 2d0a63b..c8f939a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tidal-hifi", - "version": "4.2.0", + "version": "4.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "tidal-hifi", - "version": "4.2.0", + "version": "4.3.0", "license": "MIT", "dependencies": { "@electron/remote": "^2.0.8", @@ -11386,4 +11386,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 0655493..9b04b00 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidal-hifi", - "version": "4.2.0", + "version": "4.3.0", "description": "Tidal on Electron with widevine(hifi) support", "main": "src/main.js", "scripts": { @@ -50,4 +50,4 @@ "sass-lint-auto-fix": "^0.21.2" }, "prettier": "@mastermindzh/prettier-config" -} +} \ No newline at end of file diff --git a/src/constants/settings.js b/src/constants/settings.js index 7e268f4..f84bc40 100644 --- a/src/constants/settings.js +++ b/src/constants/settings.js @@ -15,6 +15,7 @@ const settings = { playBackControl: "playBackControl", muteArtists: "muteArtists", mutedArtists: "mutedArtists", + disableBackgroundThrottle: "disableBackgroundThrottle", apiSettings: { root: "apiSettings", port: "apiSettings.port", diff --git a/src/main.js b/src/main.js index 2f8d228..abbe7db 100644 --- a/src/main.js +++ b/src/main.js @@ -91,6 +91,11 @@ function createWindow(options = {}) { // load the Tidal website mainWindow.loadURL(tidalUrl); + if (store.get(settings.disableBackgroundThrottle)) { + // prevent setInterval lag + mainWindow.webContents.setBackgroundThrottling(false); + } + // run stuff after first load mainWindow.webContents.once("did-finish-load", () => {}); diff --git a/src/pages/settings/preload.js b/src/pages/settings/preload.js index 1afa9ef..fc663a9 100644 --- a/src/pages/settings/preload.js +++ b/src/pages/settings/preload.js @@ -10,6 +10,7 @@ let trayIcon, port, menuBar, mutedArtists, + disableBackgroundThrottle, singleInstance, disableHardwareMediaKeys, gpuRasterization; @@ -38,6 +39,7 @@ function refreshSettings() { singleInstance.checked = store.get(settings.singleInstance); disableHardwareMediaKeys.checked = store.get(settings.flags.disableHardwareMediaKeys); gpuRasterization.checked = store.get(settings.flags.gpuRasterization); + disableBackgroundThrottle.checked = store.get("disableBackgroundThrottle"); } /** @@ -117,6 +119,7 @@ window.addEventListener("DOMContentLoaded", () => { enableDiscord = get("enableDiscord"); muteArtists = get("muteArtists"); mutedArtists = get("mutedArtists"); + disableBackgroundThrottle = get("disableBackgroundThrottle"); singleInstance = get("singleInstance"); disableHardwareMediaKeys = get("disableHardwareMediaKeys"); gpuRasterization = get("gpuRasterization"); @@ -135,6 +138,7 @@ window.addEventListener("DOMContentLoaded", () => { addInputListener(minimizeOnClose, settings.minimizeOnClose); addInputListener(muteArtists, settings.muteArtists); addTextAreaListener(mutedArtists, settings.mutedArtists); + addInputListener(disableBackgroundThrottle, settings.disableBackgroundThrottle); addInputListener(singleInstance, settings.singleInstance); addInputListener(disableHardwareMediaKeys, settings.flags.disableHardwareMediaKeys); addInputListener(gpuRasterization, settings.flags.gpuRasterization); diff --git a/src/pages/settings/settings.html b/src/pages/settings/settings.html index 0ade76d..6ec8991 100644 --- a/src/pages/settings/settings.html +++ b/src/pages/settings/settings.html @@ -222,6 +222,16 @@ +
+
+

Disable Background Throttling

+

Makes app more responsive while in the background, at the cost of performance.

+
+ +
@@ -245,4 +255,4 @@ - + \ No newline at end of file diff --git a/src/scripts/settings.js b/src/scripts/settings.js index 8d55ca5..0601934 100644 --- a/src/scripts/settings.js +++ b/src/scripts/settings.js @@ -12,6 +12,7 @@ const store = new Store({ playBackControl: true, muteArtists: false, mutedArtists: ["TIDAL"], + disableBackgroundThrottle: true, menuBar: true, apiSettings: { port: 47836,