1- const { notificationImage, icons } = require ( "./utils" ) ;
2- const getSongControls = require ( '../../providers/song-controls' ) ;
3- const registerCallback = require ( "../../providers/song-info" ) ;
4- const notifier = require ( "node-notifier" ) ;
1+ const { notificationImage, icons } = require ( "../utils" ) ;
2+ const getSongControls = require ( '../../../providers/song-controls' ) ;
3+ const registerCallback = require ( "../../../providers/song-info" ) ;
4+ const is = require ( "electron-is" ) ;
5+ const WindowsToaster = require ( 'node-notifier' ) . WindowsToaster ;
6+
7+ const notifier = new WindowsToaster ( { withFallback : true } ) ;
58
69//store song controls reference on launch
710let controls ;
@@ -17,11 +20,11 @@ module.exports = (win, unpauseNotification) => {
1720
1821 // Register songInfoCallback
1922 registerCallback ( songInfo => {
20- if ( ! songInfo . isPaused && ( songInfo . url !== currentUrl || notificationOnUnpause ) ) {
23+ if ( ! songInfo . isPaused && ( songInfo . url !== currentUrl || notificationOnUnpause ) ) {
2124 currentUrl = songInfo . url ;
2225 sendToaster ( songInfo ) ;
23- }
24- } ) ;
26+ }
27+ } ) ;
2528
2629 win . webContents . once ( "closed" , ( ) => {
2730 deleteNotification ( )
@@ -48,7 +51,7 @@ function sendToaster(songInfo) {
4851 //download image and get path
4952 let imgSrc = notificationImage ( songInfo , true ) ;
5053 toDelete = {
51- //app id undefined - will break buttons
54+ appID : is . dev ( ) ? undefined : "com.github.th-ch.youtube-music" ,
5255 title : songInfo . title || "Playing" ,
5356 message : songInfo . artist ,
5457 id : parseInt ( Math . random ( ) * 1000000 , 10 ) ,
0 commit comments