Browse Source

Show notifications on playback start and manual track change.

master
Stanislav N. aka pztrn 2 years ago
committed by Jeff
parent
commit
88818ef3ff
  1. 12
      src/components/player/Player.tsx

12
src/components/player/Player.tsx

@ -637,6 +637,16 @@ const Player = ({ currentEntryList, muted, children }: any, ref: any) => {
(playerNumber: 1 | 2) => { (playerNumber: 1 | 2) => {
ipcRenderer.send('current-song', playQueue.current); ipcRenderer.send('current-song', playQueue.current);
if (config.player.systemNotifications) {
// eslint-disable-next-line no-new
new Notification(playQueue.current.title, {
body: `${playQueue.current.artist.map((artist: Artist) => artist.title).join(', ')}\n${
playQueue.current.album
}`,
icon: playQueue.current.image,
});
}
if (config.serverType === Server.Jellyfin && playQueue.scrobble) { if (config.serverType === Server.Jellyfin && playQueue.scrobble) {
const currentSeek = const currentSeek =
playerNumber === 1 playerNumber === 1
@ -658,7 +668,7 @@ const Player = ({ currentEntryList, muted, children }: any, ref: any) => {
}); });
} }
}, },
[config.serverType, currentEntryList, playQueue] [config.serverType, config.player.systemNotifications, currentEntryList, playQueue]
); );
const handleOnPause = useCallback( const handleOnPause = useCallback(

Loading…
Cancel
Save