diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c88016..bdf5438 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## 2.0.0 + +### Breaking changes + +- Changed settings hotkey from "ctrl+/" to "ctrl+=" to avoid a conflict with the default Tidal hotkeys + +## Other changes + +- Added a setting to disable custom hotkeys +- Fixed the bug that backwards would register 3 times. (Twice due to a duplicate block of code + once from the default tidal hotkey) + ## 1.3.0 -- re-enabled mpris-service wit the electron downloader fixes diff --git a/README.md b/README.md index 77facde..5f85e6d 100644 --- a/README.md +++ b/README.md @@ -66,9 +66,9 @@ To install and work with the code on this project follow these steps: - HiFi playback - Notifications -- Shortcuts ([source](https://defkey.com/tidal-desktop-shortcuts)) +- Custom hotkeys ([source](https://defkey.com/tidal-desktop-shortcuts)) - API for status and playback -- [Settings feature](./docs/settings.png) to disable certain functionality. (`ctrl+/`) +- [Settings feature](./docs/settings.png) to disable certain functionality. (`ctrl+=`) ## Integrations diff --git a/build/linux/arch/.SRCINFO b/build/linux/arch/.SRCINFO index 926c53c..5ddd4a7 100644 --- a/build/linux/arch/.SRCINFO +++ b/build/linux/arch/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = tidal-hifi-git pkgdesc = The web version of listen.tidal.com running in electron with hifi support thanks to widevine. - pkgver = 1.2.0 + pkgver = 2.0.0 pkgrel = 1 url = https://github.com/Mastermindzh/tidal-hifi arch = x86_64 @@ -11,7 +11,7 @@ pkgbase = tidal-hifi-git depends = nss depends = gtk3 provides = tidal-hifi - source = https://github.com/Mastermindzh/tidal-hifi/archive/1.2.0.zip + source = https://github.com/Mastermindzh/tidal-hifi/archive/2.0.0.zip source = tidal-hifi.desktop sha512sums = e1c0e47257cebe6b2609131964f0971c3eb70fc28c86f3d7177cb3cea09a3311236f4147bafa91347210fe2c96e6bd9d2e4ac7ca5b105e0c899657645705913d sha512sums = 35f38ac308b871c1822d7f6f760f2fb54c3748cf769822cb0f0dfb90f0f5754ba9316da5e903a0d2e9839de3a43ec76f238f3f2e44021956fa1da19142081349 diff --git a/build/linux/arch/PKGBUILD b/build/linux/arch/PKGBUILD index 62b77ab..2c68deb 100644 --- a/build/linux/arch/PKGBUILD +++ b/build/linux/arch/PKGBUILD @@ -2,7 +2,7 @@ _pkgname=tidal-hifi pkgname="$_pkgname-git" -pkgver=1.2.0 +pkgver=2.0.0 pkgrel=1 pkgdesc="The web version of listen.tidal.com running in electron with hifi support thanks to widevine." arch=("x86_64") diff --git a/package-lock.json b/package-lock.json index 3b2adaa..6b83bc7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "tidal-hifi", - "version": "1.3.0", + "version": "2.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d951e16..f3a18b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tidal-hifi", - "version": "1.3.0", + "version": "2.0.0", "description": "Tidal on Electron with widevine(hifi) support", "main": "src/main.js", "scripts": { diff --git a/src/constants/settings.js b/src/constants/settings.js index 9bb3291..593e9f8 100644 --- a/src/constants/settings.js +++ b/src/constants/settings.js @@ -18,6 +18,7 @@ const settings = { port: "apiSettings.port", }, mpris: "mpris", + enableCustomHotkeys: "enableCustomHotkeys", trayIcon: "trayIcon", windowBounds: { root: "windowBounds", diff --git a/src/pages/settings/preload.js b/src/pages/settings/preload.js index 37f7e77..588e609 100644 --- a/src/pages/settings/preload.js +++ b/src/pages/settings/preload.js @@ -19,6 +19,7 @@ function refreshSettings() { menuBar.checked = store.get(settings.menuBar); trayIcon.checked = store.get(settings.trayIcon); mpris.checked = store.get(settings.mpris); + enableCustomHotkeys.checked = store.get(settings.enableCustomHotkeys); } /** @@ -79,6 +80,7 @@ window.addEventListener("DOMContentLoaded", () => { menuBar = get("menuBar"); trayIcon = get("trayIcon"); mpris = get("mprisCheckbox"); + enableCustomHotkeys = get("enableCustomHotkeys"); refreshSettings(); @@ -89,4 +91,5 @@ window.addEventListener("DOMContentLoaded", () => { addInputListener(menuBar, settings.menuBar); addInputListener(trayIcon, settings.trayIcon); addInputListener(mpris, settings.mpris); + addInputListener(enableCustomHotkeys, settings.enableCustomHotkeys); }); diff --git a/src/pages/settings/settings.html b/src/pages/settings/settings.html index f9b2ffd..6ff5252 100644 --- a/src/pages/settings/settings.html +++ b/src/pages/settings/settings.html @@ -80,6 +80,16 @@ +
+

Hotkeys

+

+ Enables extra hotkeys to achieve feature parity with the desktop apps
+

+ +
diff --git a/src/preload.js b/src/preload.js index f61377c..3f74362 100644 --- a/src/preload.js +++ b/src/preload.js @@ -29,7 +29,7 @@ const elements = { account: '*[data-test^="profile-image-button"]', settings: '*[data-test^="open-settings"]', media: '*[data-test="current-media-imagery"]', - image: '*[class^="image--"]', + image: "img", /** * Get an element from the dom @@ -101,55 +101,38 @@ function playPause() { * https://defkey.com/tidal-desktop-shortcuts */ function addHotKeys() { - hotkeys.add("Control+p", function () { - elements.click("account").click("settings"); - }); - hotkeys.add("Control+l", function () { - handleLogout(); - }); + if (store.get(settings.enableCustomHotkeys)) { + hotkeys.add("Control+p", function () { + elements.click("account").click("settings"); + }); + hotkeys.add("Control+l", function () { + handleLogout(); + }); - hotkeys.add("Control+h", function () { - elements.click("home"); - }); + hotkeys.add("Control+h", function () { + elements.click("home"); + }); - hotkeys.add("backspace", function () { - elements.click("back"); - }); + hotkeys.add("backspace", function () { + elements.click("back"); + }); - hotkeys.add("shift+backspace", function () { - elements.click("forward"); - }); + hotkeys.add("shift+backspace", function () { + elements.click("forward"); + }); - hotkeys.add("control+f", function () { - elements.focus("search"); - }); + hotkeys.add("control+u", function () { + // reloading window without cache should show the update bar if applicable + window.location.reload(true); + }); - hotkeys.add("control+u", function () { - // reloading window without cache should show the update bar if applicable - window.location.reload(true); - }); + hotkeys.add("control+r", function () { + elements.click("repeat"); + }); + } - hotkeys.add("control+left", function () { - elements.click("previous"); - }); - - hotkeys.add("control+right", function () { - elements.click("next"); - }); - - hotkeys.add("control+right", function () { - elements.click("next"); - }); - - hotkeys.add("control+s", function () { - elements.click("shuffle"); - }); - - hotkeys.add("control+r", function () { - elements.click("repeat"); - }); - - hotkeys.add("control+/", function () { + // always add the hotkey for the settings window + hotkeys.add("control+=", function () { ipcRenderer.send(globalEvents.showSettings); }); } @@ -264,11 +247,13 @@ setInterval(function () { resolve(); }, () => { - reject(); + // if the image can't be downloaded then continue without it + resolve(); } ); } else { - reject(); + // if the image can't be found on the page continue without it + resolve(); } }).then( () => { diff --git a/src/scripts/settings.js b/src/scripts/settings.js index 56c3ef4..e04f4c5 100644 --- a/src/scripts/settings.js +++ b/src/scripts/settings.js @@ -16,6 +16,7 @@ const store = new Store({ }, trayIcon: true, mpris: false, + enableCustomHotkeys: false, windowBounds: { width: 800, height: 600 }, }, });