mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-22 13:32:42 +01:00
fix: Notifications are now send at the end of the update process, allowing other events to happen sooner.
This commit is contained in:
parent
2c1c76d2d0
commit
4f72e1b35d
@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
- Fix issue #449 Discord RPC stuck on "Browsing Tidal".
|
- Fix issue #449 Discord RPC stuck on "Browsing Tidal".
|
||||||
- Fix issue #448 Add option to disable the discord rpc idle text
|
- Fix issue #448 Add option to disable the discord rpc idle text
|
||||||
|
- Notifications are now send at the end of the update process, allowing other events to happen sooner.
|
||||||
|
|
||||||
## [5.15.0]
|
## [5.15.0]
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"openapi": "3.1.0",
|
"openapi": "3.1.0",
|
||||||
"info": {
|
"info": {
|
||||||
"title": "TIDAL Hi-Fi API",
|
"title": "TIDAL Hi-Fi API",
|
||||||
"version": "5.15.0",
|
"version": "5.16.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": {
|
"license": {
|
||||||
"name": "MIT",
|
"name": "MIT",
|
||||||
|
@ -394,8 +394,24 @@ function updateMediaInfo(mediaInfo: MediaInfo, notify: boolean) {
|
|||||||
if (mediaInfo) {
|
if (mediaInfo) {
|
||||||
currentMediaInfo = mediaInfo;
|
currentMediaInfo = mediaInfo;
|
||||||
ipcRenderer.send(globalEvents.updateInfo, mediaInfo);
|
ipcRenderer.send(globalEvents.updateInfo, mediaInfo);
|
||||||
if (settingsStore.get(settings.notifications) && notify) {
|
updateMpris(mediaInfo);
|
||||||
if (currentNotification) currentNotification.close();
|
updateListenBrainz(mediaInfo);
|
||||||
|
if (notify) {
|
||||||
|
sendNotification(mediaInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* send a desktop notification if enabled in settings
|
||||||
|
* @param mediaInfo
|
||||||
|
* @param notify Whether to notify
|
||||||
|
*/
|
||||||
|
async function sendNotification(mediaInfo: MediaInfo) {
|
||||||
|
if (settingsStore.get(settings.notifications)) {
|
||||||
|
if (currentNotification) {
|
||||||
|
currentNotification.close();
|
||||||
|
}
|
||||||
currentNotification = new Notification({
|
currentNotification = new Notification({
|
||||||
title: mediaInfo.title,
|
title: mediaInfo.title,
|
||||||
body: mediaInfo.artists,
|
body: mediaInfo.artists,
|
||||||
@ -403,10 +419,6 @@ function updateMediaInfo(mediaInfo: MediaInfo, notify: boolean) {
|
|||||||
});
|
});
|
||||||
currentNotification.show();
|
currentNotification.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
updateMpris(mediaInfo);
|
|
||||||
updateListenBrainz(mediaInfo);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function addMPRIS() {
|
function addMPRIS() {
|
||||||
|
Loading…
Reference in New Issue
Block a user