Compare commits
No commits in common. "81b81580c66e5ce609ec2c13364d71b90209a51d" and "40d80e08725f604c7252bd082e99a6d97a22a510" have entirely different histories.
81b81580c6
...
40d80e0872
@ -13,8 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [5.6.0]
|
## [5.6.0]
|
||||||
|
|
||||||
- Added support for Wayland (on by default) fixes [#262](https://github.com/Mastermindzh/tidal-hifi/issues/262) and [#157](https://github.com/Mastermindzh/tidal-hifi/issues/157)
|
- Added support for Wayland (on by default) fixes [#262](https://github.com/Mastermindzh/tidal-hifi/issues/262) and [#157](https://github.com/Mastermindzh/tidal-hifi/issues/157)
|
||||||
- Made it clear in the readme that this tidal-hifi client supports High & Max audio settings. fixes [#261](https://github.com/Mastermindzh/tidal-hifi/issues/261)
|
- Made it clear in the readme that this TIDAL Hi-Fi client supports High & Max audio settings. fixes [#261](https://github.com/Mastermindzh/tidal-hifi/issues/261)
|
||||||
- Added app suspension inhibitors when music is playing. fixes [#257](https://github.com/Mastermindzh/tidal-hifi/issues/257)
|
|
||||||
- Fixed bug with theme files from user directory trying to load: "an error occurred reading the theme file"
|
- Fixed bug with theme files from user directory trying to load: "an error occurred reading the theme file"
|
||||||
- Fixed: config flags not being set correctly
|
- Fixed: config flags not being set correctly
|
||||||
- [DEV]:
|
- [DEV]:
|
||||||
|
@ -10,7 +10,7 @@ The web version of [listen.tidal.com](https://listen.tidal.com) running in elect
|
|||||||
|
|
||||||
<!-- toc -->
|
<!-- toc -->
|
||||||
|
|
||||||
- [TIDAL Hi-Fi (Max quality) ](#tidal-hi-fi-max-quality-)
|
- [TIDAL Hi-Fi (Max quality)](#tidal-hi-fi-max-quality-)
|
||||||
- [Table of Contents](#table-of-contents)
|
- [Table of Contents](#table-of-contents)
|
||||||
- [Features](#features)
|
- [Features](#features)
|
||||||
- [Contributions](#contributions)
|
- [Contributions](#contributions)
|
||||||
@ -41,7 +41,6 @@ The web version of [listen.tidal.com](https://listen.tidal.com) running in elect
|
|||||||
- Notifications
|
- Notifications
|
||||||
- Custom [theming](./docs/theming.md)
|
- Custom [theming](./docs/theming.md)
|
||||||
- Custom hotkeys ([source](https://defkey.com/tidal-desktop-shortcuts))
|
- Custom hotkeys ([source](https://defkey.com/tidal-desktop-shortcuts))
|
||||||
- Better icons thanks to [Papirus-icon-theme](https://github.com/PapirusDevelopmentTeam/papirus-icon-theme/)
|
|
||||||
- [Settings feature](./docs/images/settings.png) to disable certain functionality. (`ctrl+=` or `ctrl+0`)
|
- [Settings feature](./docs/images/settings.png) to disable certain functionality. (`ctrl+=` or `ctrl+0`)
|
||||||
- API for status and playback
|
- API for status and playback
|
||||||
- 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))
|
- 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))
|
||||||
|
11
SECURITY.md
@ -1,11 +0,0 @@
|
|||||||
# Security Policy
|
|
||||||
|
|
||||||
## Supported Versions
|
|
||||||
|
|
||||||
Only the very latest 😄.
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
If you find a vulnerability just add it as an issue.
|
|
||||||
If there's an especially bad vulnerability that you don't want to make public just send me a private message (email, discord, wherever).
|
|
||||||
|
|
BIN
assets/TIDAL.icns
Executable file
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 102 KiB |
BIN
assets/icon.png
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 5.6 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 9.8 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 9.4 KiB |
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 102 KiB |
BIN
build/icon.icns
Normal file → Executable file
BIN
build/icon.png
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 102 KiB |
@ -1,16 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ "$1" != "" ]; then # check if arg 1 is present
|
|
||||||
FILE=$1
|
|
||||||
else
|
|
||||||
echo "Please provide a file as an argument."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
SIZES=("16x16" "22x22" "24x24" "32x32" "48x48" "64x64" "128x128" "256x256" "384x384")
|
|
||||||
|
|
||||||
echo "Resizing $FILE..."
|
|
||||||
|
|
||||||
for i in "${SIZES[@]}"; do
|
|
||||||
convert "$FILE" -resize "$i" "$i.png"
|
|
||||||
done
|
|
@ -1,65 +0,0 @@
|
|||||||
import { PowerSaveBlocker, powerSaveBlocker } from "electron";
|
|
||||||
import { Logger } from "../logger";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Start blocking idle/screen timeouts
|
|
||||||
* @param blocker optional instance of the powerSaveBlocker to use
|
|
||||||
* @returns id of current block
|
|
||||||
*/
|
|
||||||
export const acquireInhibitor = (blocker?: PowerSaveBlocker): number => {
|
|
||||||
const currentBlocker = blocker ?? powerSaveBlocker;
|
|
||||||
const blockId = currentBlocker.start("prevent-app-suspension");
|
|
||||||
Logger.log(`Started preventing app suspension with id: ${blockId}`);
|
|
||||||
return blockId;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check whether there is a blocker active for the current id, if not start it.
|
|
||||||
* @param id id of inhibitor you want to check activity against
|
|
||||||
* @param blocker optional instance of the powerSaveBlocker to use
|
|
||||||
*/
|
|
||||||
export const acquireInhibitorIfInactive = (id: number, blocker?: PowerSaveBlocker): number => {
|
|
||||||
const currentBlocker = blocker ?? powerSaveBlocker;
|
|
||||||
if (!isInhibitorActive(id, currentBlocker)) {
|
|
||||||
return acquireInhibitor();
|
|
||||||
}
|
|
||||||
|
|
||||||
return id;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* stop blocking idle/screen timeouts
|
|
||||||
* @param id id of inhibitor you want to check activity against
|
|
||||||
* @param blocker optional instance of the powerSaveBlocker to use
|
|
||||||
*/
|
|
||||||
export const releaseInhibitor = (id: number, blocker?: PowerSaveBlocker) => {
|
|
||||||
try {
|
|
||||||
const currentBlocker = blocker ?? powerSaveBlocker;
|
|
||||||
currentBlocker.stop(id);
|
|
||||||
Logger.log(`Released inhibitor with id: ${id}`);
|
|
||||||
} catch (error) {
|
|
||||||
Logger.log("Releasing inhibitor failed");
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* stop blocking idle/screen timeouts if a inhibitor is active
|
|
||||||
* @param id id of inhibitor you want to check activity against
|
|
||||||
* @param blocker optional instance of the powerSaveBlocker to use
|
|
||||||
*/
|
|
||||||
export const releaseInhibitorIfActive = (id: number, blocker?: PowerSaveBlocker) => {
|
|
||||||
const currentBlocker = blocker ?? powerSaveBlocker;
|
|
||||||
if (isInhibitorActive(id, currentBlocker)) {
|
|
||||||
releaseInhibitor(id, currentBlocker);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check whether the inhibitor is active
|
|
||||||
* @param id id of inhibitor you want to check activity against
|
|
||||||
* @param blocker optional instance of the powerSaveBlocker to use
|
|
||||||
*/
|
|
||||||
export const isInhibitorActive = (id: number, blocker?: PowerSaveBlocker) => {
|
|
||||||
const currentBlocker = blocker ?? powerSaveBlocker;
|
|
||||||
return currentBlocker.isStarted(id);
|
|
||||||
};
|
|
@ -1,4 +1,4 @@
|
|||||||
import { IpcMain, ipcMain, IpcMainEvent, ipcRenderer } from "electron";
|
import { IpcMain, ipcRenderer, ipcMain } from "electron";
|
||||||
import { globalEvents } from "../constants/globalEvents";
|
import { globalEvents } from "../constants/globalEvents";
|
||||||
|
|
||||||
export class Logger {
|
export class Logger {
|
||||||
@ -7,13 +7,10 @@ export class Logger {
|
|||||||
* @param ipcMain main thread IPC client so we can subscribe to events
|
* @param ipcMain main thread IPC client so we can subscribe to events
|
||||||
*/
|
*/
|
||||||
public static watch(ipcMain: IpcMain) {
|
public static watch(ipcMain: IpcMain) {
|
||||||
ipcMain.on(
|
ipcMain.on(globalEvents.log, (event, message) => {
|
||||||
globalEvents.log,
|
const { content, object } = message;
|
||||||
(event: IpcMainEvent | { content: string; message: string }, message) => {
|
|
||||||
const { content, object } = message ?? event;
|
|
||||||
this.logToSTDOut(content, object);
|
this.logToSTDOut(content, object);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Log content to STDOut
|
* Log content to STDOut
|
||||||
@ -26,6 +23,7 @@ export class Logger {
|
|||||||
} else {
|
} else {
|
||||||
ipcMain.emit(globalEvents.log, { content, object });
|
ipcMain.emit(globalEvents.log, { content, object });
|
||||||
}
|
}
|
||||||
|
this.logToSTDOut(content, object);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
15
src/main.ts
@ -1,7 +1,7 @@
|
|||||||
import { enable, initialize } from "@electron/remote/main";
|
import { enable, initialize } from "@electron/remote/main";
|
||||||
import {
|
import {
|
||||||
app,
|
|
||||||
BrowserWindow,
|
BrowserWindow,
|
||||||
|
app,
|
||||||
components,
|
components,
|
||||||
globalShortcut,
|
globalShortcut,
|
||||||
ipcMain,
|
ipcMain,
|
||||||
@ -13,14 +13,9 @@ import { globalEvents } from "./constants/globalEvents";
|
|||||||
import { mediaKeys } from "./constants/mediaKeys";
|
import { mediaKeys } from "./constants/mediaKeys";
|
||||||
import { settings } from "./constants/settings";
|
import { settings } from "./constants/settings";
|
||||||
import { setDefaultFlags, setManagedFlagsFromSettings } from "./features/flags/flags";
|
import { setDefaultFlags, setManagedFlagsFromSettings } from "./features/flags/flags";
|
||||||
import {
|
|
||||||
acquireInhibitorIfInactive,
|
|
||||||
releaseInhibitorIfActive,
|
|
||||||
} from "./features/idleInhibitor/idleInhibitor";
|
|
||||||
import { Logger } from "./features/logger";
|
import { Logger } from "./features/logger";
|
||||||
import { Songwhip } from "./features/songwhip/songwhip";
|
import { Songwhip } from "./features/songwhip/songwhip";
|
||||||
import { MediaInfo } from "./models/mediaInfo";
|
import { MediaInfo } from "./models/mediaInfo";
|
||||||
import { MediaStatus } from "./models/mediaStatus";
|
|
||||||
import { initRPC, rpc, unRPC } from "./scripts/discord";
|
import { initRPC, rpc, unRPC } from "./scripts/discord";
|
||||||
import { startExpress } from "./scripts/express";
|
import { startExpress } from "./scripts/express";
|
||||||
import { updateMediaInfo } from "./scripts/mediaInfo";
|
import { updateMediaInfo } from "./scripts/mediaInfo";
|
||||||
@ -34,7 +29,6 @@ import {
|
|||||||
} from "./scripts/settings";
|
} from "./scripts/settings";
|
||||||
import { addTray, refreshTray } from "./scripts/tray";
|
import { addTray, refreshTray } from "./scripts/tray";
|
||||||
const tidalUrl = "https://listen.tidal.com";
|
const tidalUrl = "https://listen.tidal.com";
|
||||||
let mainInhibitorId = -1;
|
|
||||||
|
|
||||||
initialize();
|
initialize();
|
||||||
let mainWindow: BrowserWindow;
|
let mainWindow: BrowserWindow;
|
||||||
@ -116,7 +110,6 @@ function createWindow(options = { x: 0, y: 0, backgroundColor: "white" }) {
|
|||||||
});
|
});
|
||||||
// Emitted when the window is closed.
|
// Emitted when the window is closed.
|
||||||
mainWindow.on("closed", function () {
|
mainWindow.on("closed", function () {
|
||||||
releaseInhibitorIfActive(mainInhibitorId);
|
|
||||||
closeSettingsWindow();
|
closeSettingsWindow();
|
||||||
app.quit();
|
app.quit();
|
||||||
});
|
});
|
||||||
@ -201,12 +194,6 @@ app.on("browser-window-created", (_, window) => {
|
|||||||
// IPC
|
// IPC
|
||||||
ipcMain.on(globalEvents.updateInfo, (_event, arg: MediaInfo) => {
|
ipcMain.on(globalEvents.updateInfo, (_event, arg: MediaInfo) => {
|
||||||
updateMediaInfo(arg);
|
updateMediaInfo(arg);
|
||||||
if (arg.status === MediaStatus.playing) {
|
|
||||||
mainInhibitorId = acquireInhibitorIfInactive(mainInhibitorId);
|
|
||||||
} else {
|
|
||||||
releaseInhibitorIfActive(mainInhibitorId);
|
|
||||||
mainInhibitorId = -1;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ipcMain.on(globalEvents.hideSettings, () => {
|
ipcMain.on(globalEvents.hideSettings, () => {
|
||||||
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 102 KiB |