mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-09-09 21:34:44 +02:00
Compare commits
37 Commits
Author | SHA1 | Date | |
---|---|---|---|
05b422e045 | |||
35289d8216 | |||
ea42b79cd8 | |||
6d859cf780 | |||
af20092053 | |||
166ca353cf | |||
b807aa2f76 | |||
|
ef8ffe47f5 | ||
ba7b2a5717 | |||
0d93bedb4d | |||
|
1de71aa82b | ||
|
b2e68f5a8f | ||
|
a2a2023853 | ||
|
26c8a38350 | ||
eb93fbc35d | |||
|
d3c56fa445 | ||
6998992011 | |||
108e1d65d4 | |||
1097f83911 | |||
8c734777cc | |||
|
de17ac6113 | ||
|
ced41c00d7 | ||
|
744016f307 | ||
|
ad8ef71c6b | ||
d0f9a34f9c | |||
3b316f2301 | |||
c0d9cd2834 | |||
0620d87d8b | |||
57b7f9148f | |||
63ccff97ea | |||
3a4d23738f | |||
c96bdb0d28 | |||
|
115d8c6c5c | ||
|
cd2a068470 | ||
bf260b14e0 | |||
d161a68c95 | |||
|
9de8cea50e |
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 19
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 19
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
|
||||
@@ -36,6 +36,6 @@ jobs:
|
||||
- uses: actions/checkout@master
|
||||
- uses: actions/setup-node@master
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 19
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
|
Binary file not shown.
27
CHANGELOG.md
27
CHANGELOG.md
@@ -4,13 +4,38 @@ 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).
|
||||
|
||||
## 5.0.0
|
||||
|
||||
- Replaced "muting artists" with a full implementation of an Adblock mechanism
|
||||
> Disabled audio & visual ads, unlocked lyrics, suggested track, track info, unlimited skips thanks to uBlockOrigin custom filters ([source](https://github.com/uBlockOrigin/uAssets/issues/17495))
|
||||
|
||||
- @thanasistrisp updated Electron to 24.1.2 and fixed the tray bug :)
|
||||
|
||||
## 4.4.0
|
||||
|
||||
- Updated shortcut hint on the menubar to reflect the new `ctrl+=` shortcut.
|
||||
- Reverted icon path to `icon.png` instead of the hardcoded linux path.
|
||||
- Add support to autoHide the menubar and showing it with the `alt` key.
|
||||
- Move the quit command from the system sub-menu to the main menu
|
||||
- Added single click focus/show on the tray icon
|
||||
- Doesn't work on all platforms. Nothing I can do about that unfortunately!
|
||||
- Added a list of artists to automatically skip.
|
||||
- I don't like the vast majority of dutch music so I added one of them to my list to test: [./docs/no-dutch-music.mp4](./docs/no-dutch-music.mp4)
|
||||
|
||||
## 4.3.1
|
||||
|
||||
- fix: App always requests a default-url-handler-scheme change on start
|
||||
|
||||
## 4.3.0
|
||||
|
||||
- Added a setting to disable background throttling ([docs](https://www.electronjs.org/docs/latest/api/browser-window))
|
||||
|
||||
## 4.2.0
|
||||
|
||||
- New settings window by BlueManCZ
|
||||
- Fixed the desktop files in electron-builder
|
||||
- icon is set to new static path based on Arch/Debian
|
||||
- Name has changed to Tidal-Hifi
|
||||
-
|
||||
|
||||
## 4.1.2
|
||||
|
||||
|
40
README.md
40
README.md
@@ -1,39 +1,43 @@
|
||||
<h1>
|
||||
Tidal-hifi
|
||||
<img src = "./build/icon.png" height="40" align="right" />
|
||||
</h1>
|
||||
# Tidal-hifi<img src = "./build/icon.png" height="40" align="right"/>
|
||||
|
||||

|
||||
|
||||
The web version of [listen.tidal.com](https://listen.tidal.com) running in electron with hifi support thanks to widevine.
|
||||
|
||||

|
||||
|
||||
## Table of contents
|
||||
## Table of Contents
|
||||
|
||||
<!-- toc -->
|
||||
|
||||
- [Installation](#installation)
|
||||
* [Using releases](#using-releases)
|
||||
* [Snap](#snap)
|
||||
* [Arch Linux](#arch-linux)
|
||||
* [Flatpak](#flatpak)
|
||||
* [Nix](#nix)
|
||||
* [Using source](#using-source)
|
||||
- [Dependencies](#dependencies)
|
||||
- [Using releases](#using-releases)
|
||||
- [Snap](#snap)
|
||||
- [Arch Linux](#arch-linux)
|
||||
- [Flatpak](#flatpak)
|
||||
- [Nix](#nix)
|
||||
- [Using source](#using-source)
|
||||
- [Features](#features)
|
||||
- [Integrations](#integrations)
|
||||
* [Known bugs](#known-bugs)
|
||||
+ [last.fm doesn't work out of the box. Use rescrobbler as a workaround](#lastfm-doesnt-work-out-of-the-box-use-rescrobbler-as-a-workaround)
|
||||
- [Known bugs](#known-bugs)
|
||||
- [last.fm doesn't work out of the box. Use rescrobbler as a workaround](#lastfm-doesnt-work-out-of-the-box-use-rescrobbler-as-a-workaround)
|
||||
- [Why](#why)
|
||||
- [Why not extend existing projects?](#why-not-extend-existing-projects)
|
||||
- [Special thanks to...](#special-thanks-to)
|
||||
- [Special thanks to](#special-thanks-to)
|
||||
- [Buy me a coffee? Please don't](#buy-me-a-coffee-please-dont)
|
||||
- [Images](#images)
|
||||
* [Settings window](#settings-window)
|
||||
* [User setups](#user-setups)
|
||||
- [Settings window](#settings-window)
|
||||
- [User setups](#user-setups)
|
||||
|
||||
<!-- tocstop -->
|
||||
|
||||
## Installation
|
||||
|
||||
### Dependencies
|
||||
|
||||
Note that you **need** a notification library such as [libnotify](https://github.com/GNOME/libnotify) or [dunst](https://github.com/dunst-project/dunst) in order for the software to work properly.
|
||||
|
||||
### Using releases
|
||||
|
||||
Various packaged versions of the software are available on the [releases](https://github.com/Mastermindzh/tidal-hifi/releases) tab.
|
||||
@@ -93,7 +97,7 @@ To install and work with the code on this project follow these steps:
|
||||
- Notifications
|
||||
- Custom hotkeys ([source](https://defkey.com/tidal-desktop-shortcuts))
|
||||
- API for status and playback
|
||||
- [Mute artists automatically (defaults to "Tidal")]("./docs/muting-artists.md")
|
||||
- Disabled audio & visual ads, unlocked lyrics, suggested track, track info, and unlimited skips thanks to uBlockOrigin custom filters ([source](https://github.com/uBlockOrigin/uAssets/issues/17495))
|
||||
- Custom [integrations](#integrations)
|
||||
- [Settings feature](./docs/settings.png) to disable certain functionality. (`ctrl+=` or `ctrl+0`)
|
||||
- AlbumArt in integrations ([best-effort](https://github.com/Mastermindzh/tidal-hifi/pull/88#pullrequestreview-840814847))
|
||||
@@ -139,7 +143,7 @@ Whilst there are a handful of projects attempting to run Tidal on Electron they
|
||||
|
||||
Sometimes it's just easier to start over, cover my own needs and then making it available to the public :)
|
||||
|
||||
## Special thanks to...
|
||||
## Special thanks to
|
||||
|
||||
- [Castlabs](https://castlabs.com/)
|
||||
For maintaining Electron with Widevine CDM installation, Verified Media Path (VMP), and persistent licenses (StorageID)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
appId: com.rickvanlieshout.tidal-hifi
|
||||
electronVersion: 19.0.5
|
||||
electronVersion: 24.1.2
|
||||
electronDownload:
|
||||
version: 19.0.5+wvcus
|
||||
version: 24.1.2+wvcus
|
||||
mirror: https://github.com/castlabs/electron-releases/releases/download/v
|
||||
snap:
|
||||
plugs:
|
||||
@@ -18,7 +18,7 @@ linux:
|
||||
Name: TIDAL Hi-Fi
|
||||
GenericName: TIDAL Hi-Fi
|
||||
Comment: The web version of listen.tidal.com running in electron with hifi support thanks to widevine.
|
||||
Icon: /usr/share/icons/hicolor/0x0/apps/tidal-hifi.png
|
||||
Icon: icon.png
|
||||
StartupNotify: true
|
||||
Terminal: false
|
||||
Type: Application
|
||||
|
@@ -1,11 +0,0 @@
|
||||
# Muting artists
|
||||
|
||||
If you feel that some of your music is embarrassing for others you can mute specific artists in the settings window.
|
||||
This functionality is inspired by the [adblock ticket](https://github.com/Mastermindzh/tidal-hifi/issues/112), and whilst I personally feel you should simply buy Tidal, I also believe in muting sound that you don't want to hear.
|
||||
|
||||
Anyway, to block an artist, open the settings window (see image below) and enter a list of artists in the textarea as seen below.
|
||||
Don't forget to turn the feature on and Tidal-hifi will automatically mute the player whenever that artist is playing.
|
||||
|
||||
This will allow you to skip the song without anyone noticing. (you can always say "no idea, it seems to have no audio").
|
||||
|
||||

|
BIN
docs/no-dutch-music.mp4
Normal file
BIN
docs/no-dutch-music.mp4
Normal file
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 103 KiB |
8309
package-lock.json
generated
8309
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tidal-hifi",
|
||||
"version": "4.2.0",
|
||||
"version": "5.0.0",
|
||||
"description": "Tidal on Electron with widevine(hifi) support",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
@@ -31,21 +31,22 @@
|
||||
"homepage": "https://github.com/Mastermindzh/tidal-hifi",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@electron/remote": "^2.0.8",
|
||||
"@electron/remote": "^2.0.9",
|
||||
"discord-rpc": "^4.0.1",
|
||||
"electron-store": "^8.1.0",
|
||||
"express": "^4.18.1",
|
||||
"hotkeys-js": "^3.9.4",
|
||||
"express": "^4.18.2",
|
||||
"hotkeys-js": "^3.10.2",
|
||||
"mpris-service": "^2.1.2",
|
||||
"request": "^2.88.2",
|
||||
"sass": "^1.54.9"
|
||||
"sass": "^1.62.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mastermindzh/prettier-config": "^1.0.0",
|
||||
"electron": "git+https://github.com/castlabs/electron-releases.git#v19.0.5+wvcus",
|
||||
"electron-builder": "^23.3.3",
|
||||
"js-yaml": "^3.14.1",
|
||||
"prettier": "^2.7.1",
|
||||
"electron": "git+https://github.com/castlabs/electron-releases.git#v24.1.2+wvcus",
|
||||
"electron-builder": "^24.2.1",
|
||||
"js-yaml": "^4.1.0",
|
||||
"markdown-toc": "^1.2.0",
|
||||
"prettier": "^2.8.7",
|
||||
"sass-lint": "^1.13.1",
|
||||
"sass-lint-auto-fix": "^0.21.2"
|
||||
},
|
||||
|
@@ -13,8 +13,10 @@ const settings = {
|
||||
api: "api",
|
||||
menuBar: "menuBar",
|
||||
playBackControl: "playBackControl",
|
||||
muteArtists: "muteArtists",
|
||||
mutedArtists: "mutedArtists",
|
||||
skipArtists: "skipArtists",
|
||||
skippedArtists: "skippedArtists",
|
||||
adBlock: "adBlock",
|
||||
disableBackgroundThrottle: "disableBackgroundThrottle",
|
||||
apiSettings: {
|
||||
root: "apiSettings",
|
||||
port: "apiSettings.port",
|
||||
|
36
src/main.js
36
src/main.js
@@ -1,5 +1,13 @@
|
||||
require("@electron/remote/main").initialize();
|
||||
const { app, BrowserWindow, components, globalShortcut, ipcMain, protocol } = require("electron");
|
||||
const {
|
||||
app,
|
||||
BrowserWindow,
|
||||
components,
|
||||
globalShortcut,
|
||||
ipcMain,
|
||||
protocol,
|
||||
session,
|
||||
} = require("electron");
|
||||
const {
|
||||
settings,
|
||||
store,
|
||||
@@ -49,7 +57,10 @@ function setFlags() {
|
||||
*
|
||||
*/
|
||||
function syncMenuBarWithStore() {
|
||||
mainWindow.setMenuBarVisibility(store.get(settings.menuBar));
|
||||
const fixedMenuBar = store.get(settings.menuBar);
|
||||
|
||||
mainWindow.autoHideMenuBar = !fixedMenuBar;
|
||||
mainWindow.setMenuBarVisibility(fixedMenuBar);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -78,7 +89,9 @@ function createWindow(options = {}) {
|
||||
height: store && store.get(settings.windowBounds.height),
|
||||
icon,
|
||||
backgroundColor: options.backgroundColor,
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
sandbox: false,
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
plugins: true,
|
||||
devTools: true, // I like tinkering, others might too
|
||||
@@ -91,6 +104,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", () => {});
|
||||
|
||||
@@ -118,7 +136,9 @@ function registerHttpProtocols() {
|
||||
protocol.registerHttpProtocol(PROTOCOL_PREFIX, (request, _callback) => {
|
||||
mainWindow.loadURL(`${tidalUrl}/${request.url.substring(PROTOCOL_PREFIX.length + 3)}`);
|
||||
});
|
||||
app.setAsDefaultProtocolClient(PROTOCOL_PREFIX);
|
||||
if (!app.isDefaultProtocolClient(PROTOCOL_PREFIX)) {
|
||||
app.setAsDefaultProtocolClient(PROTOCOL_PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
function addGlobalShortcuts() {
|
||||
@@ -135,6 +155,16 @@ function addGlobalShortcuts() {
|
||||
app.on("ready", async () => {
|
||||
if (isMainInstanceOrMultipleInstancesAllowed()) {
|
||||
await components.whenReady();
|
||||
|
||||
// Adblock
|
||||
if (store.get(settings.adBlock)) {
|
||||
const filter = { urls: ["https://listen.tidal.com/*"] };
|
||||
session.defaultSession.webRequest.onBeforeRequest(filter, (details, callback) => {
|
||||
if (details.url.match(/\/users\/.*\d\?country/)) callback({ cancel: true });
|
||||
else callback({ cancel: false });
|
||||
});
|
||||
}
|
||||
|
||||
createWindow();
|
||||
addMenu(mainWindow);
|
||||
createSettingsWindow();
|
||||
|
@@ -3,13 +3,15 @@ let trayIcon,
|
||||
mpris,
|
||||
enableCustomHotkeys,
|
||||
enableDiscord,
|
||||
muteArtists,
|
||||
skipArtists,
|
||||
notifications,
|
||||
playBackControl,
|
||||
api,
|
||||
port,
|
||||
menuBar,
|
||||
mutedArtists,
|
||||
skippedArtists,
|
||||
adBlock,
|
||||
disableBackgroundThrottle,
|
||||
singleInstance,
|
||||
disableHardwareMediaKeys,
|
||||
gpuRasterization;
|
||||
@@ -33,11 +35,13 @@ function refreshSettings() {
|
||||
enableCustomHotkeys.checked = store.get(settings.enableCustomHotkeys);
|
||||
enableDiscord.checked = store.get(settings.enableDiscord);
|
||||
minimizeOnClose.checked = store.get(settings.minimizeOnClose);
|
||||
muteArtists.checked = store.get(settings.muteArtists);
|
||||
mutedArtists.value = store.get(settings.mutedArtists).join("\n");
|
||||
skipArtists.checked = store.get(settings.skipArtists);
|
||||
skippedArtists.value = store.get(settings.skippedArtists).join("\n");
|
||||
adBlock.checked = store.get(settings.adBlock);
|
||||
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");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -60,7 +64,7 @@ function hide() {
|
||||
*/
|
||||
function restart() {
|
||||
app.relaunch();
|
||||
app.quit();
|
||||
app.exit();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,8 +119,10 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
mpris = get("mprisCheckbox");
|
||||
enableCustomHotkeys = get("enableCustomHotkeys");
|
||||
enableDiscord = get("enableDiscord");
|
||||
muteArtists = get("muteArtists");
|
||||
mutedArtists = get("mutedArtists");
|
||||
skipArtists = get("skipArtists");
|
||||
skippedArtists = get("skippedArtists");
|
||||
adBlock = get("adBlock");
|
||||
disableBackgroundThrottle = get("disableBackgroundThrottle");
|
||||
singleInstance = get("singleInstance");
|
||||
disableHardwareMediaKeys = get("disableHardwareMediaKeys");
|
||||
gpuRasterization = get("gpuRasterization");
|
||||
@@ -133,8 +139,10 @@ window.addEventListener("DOMContentLoaded", () => {
|
||||
addInputListener(enableCustomHotkeys, settings.enableCustomHotkeys);
|
||||
addInputListener(enableDiscord, settings.enableDiscord);
|
||||
addInputListener(minimizeOnClose, settings.minimizeOnClose);
|
||||
addInputListener(muteArtists, settings.muteArtists);
|
||||
addTextAreaListener(mutedArtists, settings.mutedArtists);
|
||||
addInputListener(skipArtists, settings.skipArtists);
|
||||
addTextAreaListener(skippedArtists, settings.skippedArtists);
|
||||
addInputListener(adBlock, settings.adBlock);
|
||||
addInputListener(disableBackgroundThrottle, settings.disableBackgroundThrottle);
|
||||
addInputListener(singleInstance, settings.singleInstance);
|
||||
addInputListener(disableHardwareMediaKeys, settings.flags.disableHardwareMediaKeys);
|
||||
addInputListener(gpuRasterization, settings.flags.gpuRasterization);
|
||||
|
@@ -48,31 +48,44 @@
|
||||
<p>Show a notification when a new song starts.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="notifications" type="checkbox">
|
||||
<input id="notifications" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="group__option">
|
||||
<div class="group__description">
|
||||
<h4>Mute Artists automatically</h4>
|
||||
<p>The following list of artists (1 per line) will be muted automatically.</p>
|
||||
<h4>Skip Artists automatically</h4>
|
||||
<p>The following list of artists (1 per line) will be skipped automatically.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="muteArtists" type="checkbox">
|
||||
<input id="skipArtists" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<textarea id="skippedArtists" class="textarea" cols="40" rows="5" spellcheck="false"></textarea>
|
||||
<div class="group__option">
|
||||
<div class="group__description">
|
||||
<h4>Block ads</h4>
|
||||
<p>
|
||||
Disabled audio & visual ads, unlocked lyrics, suggested track, track info,
|
||||
unlimited skips
|
||||
</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="adBlock" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<textarea id="mutedArtists" class="textarea" cols="40" rows="5" spellcheck="false"></textarea>
|
||||
</div>
|
||||
<div class="group">
|
||||
<p class="group__title">UI</p>
|
||||
<div class="group__option">
|
||||
<div class="group__description">
|
||||
<h4>Menubar</h4>
|
||||
<p>Show TIDAL Hi-Fi's menu bar.</p>
|
||||
<h4>Fixed menubar</h4>
|
||||
<p>Always show TIDAL Hi-Fi's menu bar.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="menuBar" type="checkbox">
|
||||
<input id="menuBar" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -85,7 +98,7 @@
|
||||
<p>Show TIDAL Hi-Fi's tray icon.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="trayIcon" type="checkbox">
|
||||
<input id="trayIcon" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -95,7 +108,7 @@
|
||||
<p>Minimize window on close instead.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="minimizeOnClose" type="checkbox">
|
||||
<input id="minimizeOnClose" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -108,7 +121,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="enableCustomHotkeys" type="checkbox">
|
||||
<input id="enableCustomHotkeys" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -118,7 +131,7 @@
|
||||
<p>Prevent opening multiple TIDAL Hi-Fi's instances.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="singleInstance" type="checkbox">
|
||||
<input id="singleInstance" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -130,8 +143,8 @@
|
||||
<p class="group__title">API</p>
|
||||
<div class="group__description">
|
||||
<p>
|
||||
TIDAL Hi-Fi has a built-in web API to allow users to get current song information. You can optionally
|
||||
enable playback control as well.
|
||||
TIDAL Hi-Fi has a built-in web API to allow users to get current song information.
|
||||
You can optionally enable playback control as well.
|
||||
</p>
|
||||
</div>
|
||||
<div class="group__option">
|
||||
@@ -140,14 +153,14 @@
|
||||
<p>Enable the TIDAL Hi-Fi web API.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="apiCheckbox" type="checkbox">
|
||||
<input id="apiCheckbox" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="group__option">
|
||||
<div class="group__description">
|
||||
<label for="port">API port</label>
|
||||
<input id="port" type="text" class="text-input" name="port">
|
||||
<input id="port" type="text" class="text-input" name="port" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="group__option">
|
||||
@@ -156,7 +169,7 @@
|
||||
<p>Enable playback control from the web API.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="playBackControl" type="checkbox">
|
||||
<input id="playBackControl" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -168,18 +181,20 @@
|
||||
<p class="group__title">Integrations</p>
|
||||
<div class="group__description">
|
||||
<p>
|
||||
TIDAL Hi-Fi is extensible through the use of integrations.
|
||||
You can enable or disable them here.
|
||||
TIDAL Hi-Fi is extensible through the use of integrations. You can enable or
|
||||
disable them here.
|
||||
</p>
|
||||
</div>
|
||||
<div class="group__option">
|
||||
<div class="group__description">
|
||||
<h4>MPRIS</h4>
|
||||
<p>Enable MPRIS interface which provides a mechanism for discovery, querying and basic playback control
|
||||
on Linux systems.</p>
|
||||
<p>
|
||||
Enable MPRIS interface which provides a mechanism for discovery, querying and
|
||||
basic playback control on Linux systems.
|
||||
</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="mprisCheckbox" type="checkbox">
|
||||
<input id="mprisCheckbox" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -189,7 +204,7 @@
|
||||
<p>Show what you're listening to on Discord.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="enableDiscord" type="checkbox">
|
||||
<input id="enableDiscord" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -203,12 +218,12 @@
|
||||
<div class="group__description">
|
||||
<h4>Disable hardware built-in media keys</h4>
|
||||
<p>
|
||||
Also prevents certain desktop environments from recognizing the chrome
|
||||
MPRIS client separately from the custom MPRIS client.
|
||||
Also prevents certain desktop environments from recognizing the chrome MPRIS
|
||||
client separately from the custom MPRIS client.
|
||||
</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="disableHardwareMediaKeys" type="checkbox">
|
||||
<input id="disableHardwareMediaKeys" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -218,7 +233,19 @@
|
||||
<p>Move a part of the rendering to the GPU for increased performance.</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="gpuRasterization" type="checkbox">
|
||||
<input id="gpuRasterization" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="group__option">
|
||||
<div class="group__description">
|
||||
<h4>Disable Background Throttling</h4>
|
||||
<p>
|
||||
Makes app more responsive while in the background, at the cost of performance.
|
||||
</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
<input id="disableBackgroundThrottle" type="checkbox" />
|
||||
<span class="switch__slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
@@ -226,17 +253,20 @@
|
||||
</section>
|
||||
|
||||
<section id="about-section" class="tabs__section about-section">
|
||||
<img alt="tidal icon" class="about-section__icon" src="./icon.png">
|
||||
<img alt="tidal icon" class="about-section__icon" src="./icon.png" />
|
||||
<p class="about-section__text">
|
||||
<a class="external-link" data-url="https://github.com/Mastermindzh/tidal-hifi">TIDAL Hi-Fi</a>
|
||||
is made by <a class="external-link" data-url="https://www.rickvanlieshout.com">
|
||||
Rick van Lieshout</a>. <br>It uses <a class="external-link" data-url="https://castlabs.com/">Castlabs'</a>
|
||||
is made by
|
||||
<a class="external-link" data-url="https://www.rickvanlieshout.com">
|
||||
Rick van Lieshout</a>. <br />It uses
|
||||
<a class="external-link" data-url="https://castlabs.com/">Castlabs'</a>
|
||||
version of Electron for widevine support.
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<footer class="footer">
|
||||
<p class="footer__note">Some settings may require a restart of TIDAL Hi-Fi. To do so, click the button below:
|
||||
<p class="footer__note">
|
||||
Some settings may require a restart of TIDAL Hi-Fi. To do so, click the button below:
|
||||
</p>
|
||||
<button class="footer__button" id="restart">Restart TIDAL Hi-Fi</button>
|
||||
</footer>
|
||||
@@ -245,4 +275,4 @@
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
@@ -7,12 +7,12 @@ const { downloadFile } = require("./scripts/download");
|
||||
const statuses = require("./constants/statuses");
|
||||
const hotkeys = require("./scripts/hotkeys");
|
||||
const globalEvents = require("./constants/globalEvents");
|
||||
const { skipArtists } = require("./constants/settings");
|
||||
const notificationPath = `${app.getPath("userData")}/notification.jpg`;
|
||||
const appName = "Tidal Hifi";
|
||||
let currentSong = "";
|
||||
let player;
|
||||
let currentPlayStatus = statuses.paused;
|
||||
let isMutedArtist = true;
|
||||
|
||||
const elements = {
|
||||
play: '*[data-test="play"]',
|
||||
@@ -300,6 +300,7 @@ function updateMediaInfo(options, notify) {
|
||||
"xesam:album": options.album,
|
||||
"mpris:artUrl": options.image,
|
||||
"mpris:length": convertDuration(options.duration) * 1000 * 1000,
|
||||
"mpris:trackid": "/org/mpris/MediaPlayer2/track/" + getTrackID(),
|
||||
},
|
||||
};
|
||||
player.playbackStatus = options.status == statuses.paused ? "Paused" : "Playing";
|
||||
@@ -312,10 +313,15 @@ function updateMediaInfo(options, notify) {
|
||||
* If it's a song it returns the track URL, if not it will return undefined
|
||||
*/
|
||||
function getTrackURL() {
|
||||
const id = getTrackID();
|
||||
return `https://tidal.com/browse/track/${id}`;
|
||||
}
|
||||
|
||||
function getTrackID() {
|
||||
const URLelement = elements.get("title").querySelector("a");
|
||||
if (URLelement !== null) {
|
||||
const id = URLelement.href.replace(/[^0-9]/g, "");
|
||||
return `https://tidal.com/browse/track/${id}`;
|
||||
const id = URLelement.href.replace(/\D/g, "");
|
||||
return id;
|
||||
}
|
||||
|
||||
return window.location;
|
||||
@@ -327,8 +333,8 @@ function getTrackURL() {
|
||||
setInterval(function () {
|
||||
const title = elements.getText("title");
|
||||
const artists = elements.getArtists();
|
||||
muteArtistIfFoundInMutedArtistsList(); // doing this here so that nothing can possibly fail before we call this function
|
||||
|
||||
skipArtistsIfFoundInSkippedArtistsList(artists);
|
||||
|
||||
const album = elements.getAlbumName();
|
||||
const current = elements.getText("current");
|
||||
const duration = elements.getText("duration");
|
||||
@@ -344,12 +350,9 @@ setInterval(function () {
|
||||
duration,
|
||||
"app-name": appName,
|
||||
};
|
||||
|
||||
|
||||
|
||||
const titleOrArtistChanged = currentSong !== songDashArtistTitle;
|
||||
|
||||
|
||||
// update title, url and play info with new info
|
||||
setTitle(songDashArtistTitle);
|
||||
getTrackURL();
|
||||
@@ -383,23 +386,18 @@ setInterval(function () {
|
||||
);
|
||||
|
||||
/**
|
||||
* Checks whether the current artist is included in the "muted artists" list and if so it will automatically mute the player
|
||||
* automatically skip a song if the artists are found in the list of artists to skip
|
||||
* @param {*} artists list of artists to skip
|
||||
*/
|
||||
function muteArtistIfFoundInMutedArtistsList() {
|
||||
if (store.get(settings.muteArtists)) {
|
||||
const mutedArtists = store.get(settings.mutedArtists);
|
||||
if (mutedArtists.find((artist) => artist === artists) !== undefined) {
|
||||
if (!elements.isMuted()) {
|
||||
isMutedArtist = true;
|
||||
elements.click("volume");
|
||||
}
|
||||
} else if (isMutedArtist && elements.isMuted()) {
|
||||
elements.click("volume");
|
||||
isMutedArtist = false;
|
||||
function skipArtistsIfFoundInSkippedArtistsList(artists) {
|
||||
if (store.get(skipArtists)) {
|
||||
const skippedArtists = store.get(settings.skippedArtists);
|
||||
if (skippedArtists.find((artist) => artist === artists) !== undefined) {
|
||||
elements.click("next");
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
}, 100);
|
||||
|
||||
if (process.platform === "linux" && store.get(settings.mpris)) {
|
||||
try {
|
||||
|
@@ -8,7 +8,7 @@ const settingsMenuEntry = {
|
||||
click() {
|
||||
showSettingsWindow();
|
||||
},
|
||||
accelerator: "Control+/",
|
||||
accelerator: "Control+=",
|
||||
};
|
||||
|
||||
const quitMenuEntry = {
|
||||
@@ -110,6 +110,7 @@ menuModule.getMenu = function (mainWindow) {
|
||||
},
|
||||
},
|
||||
toggleWindow,
|
||||
quitMenuEntry,
|
||||
];
|
||||
|
||||
return Menu.buildFromTemplate(mainMenu);
|
||||
|
@@ -10,8 +10,10 @@ const store = new Store({
|
||||
notifications: true,
|
||||
api: true,
|
||||
playBackControl: true,
|
||||
muteArtists: false,
|
||||
mutedArtists: ["TIDAL"],
|
||||
skipArtists: false,
|
||||
skippedArtists: [""],
|
||||
adBlock: false,
|
||||
disableBackgroundThrottle: true,
|
||||
menuBar: true,
|
||||
apiSettings: {
|
||||
port: 47836,
|
||||
|
@@ -11,6 +11,18 @@ trayModule.addTray = function (mainWindow, options = { icon: "" }) {
|
||||
const menu = getMenu(mainWindow);
|
||||
|
||||
tray.setContextMenu(menu);
|
||||
|
||||
tray.on("click", function () {
|
||||
if (mainWindow.isVisible()) {
|
||||
if (!mainWindow.isFocused()) {
|
||||
mainWindow.focus();
|
||||
} else {
|
||||
mainWindow.hide();
|
||||
}
|
||||
} else {
|
||||
mainWindow.show();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
trayModule.refreshTray = function (mainWindow) {
|
||||
|
Reference in New Issue
Block a user