Merge 456727c0e01b70d16713bc212f17125d011c4972 into 5ff2cc68d3dcba04dcc77490056f69a55b7014a2

This commit is contained in:
Lennart 2024-03-12 08:22:28 +00:00 committed by GitHub
commit 6e359170f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,6 +28,7 @@ let currentListenBrainzDelayId: ReturnType<typeof setTimeout>;
let scrobbleWaitingForDelay = false;
let wasJustPausedOrResumed = false;
let currentMediaInfo: Options;
let currentNotification: Electron.Notification;
const elements = {
play: '*[data-test="play"]',
@ -359,7 +360,9 @@ function updateMediaInfo(options: Options, notify: boolean) {
currentMediaInfo = options;
ipcRenderer.send(globalEvents.updateInfo, options);
if (settingsStore.get(settings.notifications) && notify) {
new Notification({ title: options.title, body: options.artists, icon: options.icon }).show();
if (currentNotification) currentNotification.close();
currentNotification = new Notification({ title: options.title, body: options.artists, icon: options.icon });
currentNotification.show();
}
updateMpris(options);
updateListenBrainz(options);