mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-08-23 13:04:49 +02:00
Merge branch 'feature/update' into docs/update-picture
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
export default {
|
||||
name: "tidal-hifi",
|
||||
name: "TIDAL Hi-Fi",
|
||||
};
|
||||
|
@@ -21,7 +21,6 @@ export function setManagedFlagsFromSettings(app: App) {
|
||||
for (const [key, value] of Object.entries(flagsFromSettings)) {
|
||||
if (value) {
|
||||
flags[key].forEach((flag) => {
|
||||
Logger.log(`enabling command line option ${flag.flag} with value ${flag.value}`);
|
||||
setFlag(app, flag.flag, flag.value);
|
||||
});
|
||||
}
|
||||
@@ -37,5 +36,6 @@ export function setManagedFlagsFromSettings(app: App) {
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
function setFlag(app: App, flag: string, value?: any) {
|
||||
Logger.log(`enabling command line option ${flag} with value ${value}`);
|
||||
app.commandLine.appendSwitch(flag, value);
|
||||
}
|
||||
|
26
src/main.ts
26
src/main.ts
@@ -37,10 +37,14 @@ const tidalUrl = "https://listen.tidal.com";
|
||||
let mainInhibitorId = -1;
|
||||
|
||||
initialize();
|
||||
|
||||
let mainWindow: BrowserWindow;
|
||||
const icon = path.join(__dirname, "../assets/icon.png");
|
||||
const PROTOCOL_PREFIX = "tidal";
|
||||
const windowPreferences = {
|
||||
sandbox: false,
|
||||
plugins: true,
|
||||
devTools: true, // I like tinkering, others might too
|
||||
};
|
||||
|
||||
setDefaultFlags(app);
|
||||
setManagedFlagsFromSettings(app);
|
||||
@@ -84,10 +88,10 @@ function createWindow(options = { x: 0, y: 0, backgroundColor: "white" }) {
|
||||
backgroundColor: options.backgroundColor,
|
||||
autoHideMenuBar: true,
|
||||
webPreferences: {
|
||||
sandbox: false,
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
plugins: true,
|
||||
devTools: true, // I like tinkering, others might too
|
||||
...windowPreferences,
|
||||
...{
|
||||
preload: path.join(__dirname, "preload.js"),
|
||||
},
|
||||
},
|
||||
});
|
||||
enable(mainWindow.webContents);
|
||||
@@ -120,6 +124,18 @@ function createWindow(options = { x: 0, y: 0, backgroundColor: "white" }) {
|
||||
const { width, height } = mainWindow.getBounds();
|
||||
settingsStore.set(settings.windowBounds.root, { width, height });
|
||||
});
|
||||
mainWindow.webContents.setWindowOpenHandler(() => {
|
||||
return {
|
||||
action: "allow",
|
||||
overrideBrowserWindowOptions: {
|
||||
webPreferences: {
|
||||
sandbox: false,
|
||||
plugins: true,
|
||||
devTools: true, // I like tinkering, others might too
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function registerHttpProtocols() {
|
||||
|
@@ -118,7 +118,7 @@ function hide() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Restart tidal-hifi after changes
|
||||
* Restart TIDAL Hi-Fi after changes
|
||||
*/
|
||||
function restart() {
|
||||
app.relaunch();
|
||||
|
@@ -250,7 +250,7 @@
|
||||
<div class="group__description">
|
||||
<h4>Update frequency</h4>
|
||||
<p>
|
||||
The amount of time, in milliseconds, that tidal-hifi will refresh its playback info by scraping the
|
||||
The amount of time, in milliseconds, that TIDAL Hi-Fi will refresh its playback info by scraping the
|
||||
website.
|
||||
The default of 500 seems to work in more cases but if you are fine with a bit more resource usage you
|
||||
can decrease it as well.
|
||||
@@ -300,7 +300,7 @@
|
||||
<div class="group__description">
|
||||
<h4>Wayland support</h4>
|
||||
<p>
|
||||
Adds a couple of Electron flags to help Tidal-hifi run smoothly on the Wayland window system.
|
||||
Adds a couple of Electron flags to help TIDAL Hi-Fi run smoothly on the Wayland window system.
|
||||
</p>
|
||||
</div>
|
||||
<label class="switch">
|
||||
|
@@ -20,7 +20,7 @@ import { settingsStore } from "./scripts/settings";
|
||||
import { setTitle } from "./scripts/window-functions";
|
||||
|
||||
const notificationPath = `${app.getPath("userData")}/notification.jpg`;
|
||||
const appName = "Tidal Hifi";
|
||||
const appName = "TIDAL Hi-Fi";
|
||||
let currentSong = "";
|
||||
let player: Player;
|
||||
let currentPlayStatus = MediaStatus.paused;
|
||||
@@ -531,8 +531,8 @@ setInterval(function () {
|
||||
if (process.platform === "linux" && settingsStore.get(settings.mpris)) {
|
||||
try {
|
||||
player = Player({
|
||||
name: "tidal-hifi",
|
||||
identity: "tidal-hifi",
|
||||
name: "TIDAL Hi-Fi",
|
||||
identity: "TIDAL Hi-Fi",
|
||||
supportedUriSchemes: ["file"],
|
||||
supportedMimeTypes: [
|
||||
"audio/mpeg",
|
||||
@@ -544,7 +544,6 @@ if (process.platform === "linux" && settingsStore.get(settings.mpris)) {
|
||||
supportedInterfaces: ["player"],
|
||||
desktopEntry: "tidal-hifi",
|
||||
});
|
||||
|
||||
// Events
|
||||
const events = {
|
||||
next: "next",
|
||||
|
@@ -53,7 +53,7 @@ const observer = () => {
|
||||
const idleStatus = {
|
||||
details: `Browsing Tidal`,
|
||||
largeImageKey: "tidal-hifi-icon",
|
||||
largeImageText: `Tidal HiFi ${app.getVersion()}`,
|
||||
largeImageText: `TIDAL Hi-Fi ${app.getVersion()}`,
|
||||
instance: false,
|
||||
};
|
||||
|
||||
|
@@ -8,7 +8,7 @@ import { mediaInfo } from "./mediaInfo";
|
||||
import { settingsStore } from "./settings";
|
||||
|
||||
/**
|
||||
* Function to enable tidal-hifi's express api
|
||||
* Function to enable TIDAL Hi-Fi's express api
|
||||
*/
|
||||
|
||||
// expressModule.run = function (mainWindow)
|
||||
|
@@ -33,7 +33,6 @@ export const getMenu = function (mainWindow: BrowserWindow) {
|
||||
{
|
||||
label: name,
|
||||
submenu: [
|
||||
{ role: "about" },
|
||||
settingsMenuEntry,
|
||||
{ type: "separator" },
|
||||
{ role: "services" },
|
||||
@@ -101,12 +100,6 @@ export const getMenu = function (mainWindow: BrowserWindow) {
|
||||
],
|
||||
},
|
||||
settingsMenuEntry,
|
||||
{
|
||||
label: "About",
|
||||
click() {
|
||||
showSettingsWindow("about");
|
||||
},
|
||||
},
|
||||
toggleWindow,
|
||||
quitMenuEntry,
|
||||
];
|
||||
|
Reference in New Issue
Block a user