mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-09-17 00:59:09 +02:00
added player status and worked on getting the integrations working with i3: 9714b2fa1d
This commit is contained in:
@@ -4,6 +4,7 @@ const { settings } = require("./scripts/settings");
|
||||
const { ipcRenderer } = require("electron");
|
||||
const { app } = require("electron").remote;
|
||||
const { downloadFile } = require("./scripts/download");
|
||||
const statuses = require("./constants/statuses");
|
||||
const hotkeys = require("./scripts/hotkeys");
|
||||
const globalEvents = require("./constants/globalEvents");
|
||||
const notifier = require("node-notifier");
|
||||
@@ -210,6 +211,19 @@ function addIPCEventListeners() {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the current status of tidal (e.g playing or paused)
|
||||
*/
|
||||
function updateStatus() {
|
||||
const play = elements.get("play");
|
||||
let status = statuses.paused;
|
||||
// if play button is NOT visible tidal is playing
|
||||
if (!play) {
|
||||
status = statuses.playing;
|
||||
}
|
||||
ipcRenderer.send("update-status", status);
|
||||
}
|
||||
|
||||
/**
|
||||
* Watch for song changes and update title + notify
|
||||
*/
|
||||
@@ -218,6 +232,8 @@ setInterval(function() {
|
||||
const artists = elements.getText("artists");
|
||||
const songDashArtistTitle = `${title} - ${artists}`;
|
||||
|
||||
updateStatus();
|
||||
|
||||
if (getTitle() !== songDashArtistTitle) {
|
||||
setTitle(songDashArtistTitle);
|
||||
|
||||
|
Reference in New Issue
Block a user