diff --git a/package.json b/package.json index 453bdf48..db70d1b2 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "productName": "YouTube Music", "mac": { "identity": null, + "files": ["!plugins/taskbar-mediacontrol${/*}"], "target": [ { "target": "dmg", @@ -28,6 +29,7 @@ }, "win": { "icon": "assets/generated/icons/win/icon.ico", + "files": ["!plugins/touchbar${/*}"], "target": [ "nsis", "portable" @@ -38,6 +40,7 @@ }, "linux": { "icon": "assets/generated/icons/png", + "files": ["!plugins/{touchbar,taskbar-mediacontrol}${/*}"], "category": "AudioVideo", "target": [ "AppImage", diff --git a/plugins/notifications/back.js b/plugins/notifications/back.js index 654e3b54..f3282ed3 100644 --- a/plugins/notifications/back.js +++ b/plugins/notifications/back.js @@ -3,8 +3,6 @@ const is = require("electron-is"); const registerCallback = require("../../providers/song-info"); const { notificationImage } = require("./utils"); -const setupInteractive = require("./interactive") - const notify = (info, options) => { // Fill the notification with content @@ -41,6 +39,6 @@ const setup = (options) => { module.exports = (win, options) => { // Register the callback for new song information is.windows() && options.interactive ? - setupInteractive(win, options.unpauseNotification) : + require("./interactive")(win, options.unpauseNotification) : setup(options); }; diff --git a/plugins/notifications/interactive.js b/plugins/notifications/interactive.js index c30c1020..0fc0f0c6 100644 --- a/plugins/notifications/interactive.js +++ b/plugins/notifications/interactive.js @@ -1,7 +1,10 @@ -const { notificationImage, icons } = require("./utils"); -const getSongControls = require('../../providers/song-controls'); -const registerCallback = require("../../providers/song-info"); -const notifier = require("node-notifier"); +const { notificationImage, icons } = require("../utils"); +const getSongControls = require('../../../providers/song-controls'); +const registerCallback = require("../../../providers/song-info"); +const is = require("electron-is"); +const WindowsToaster = require('node-notifier').WindowsToaster; + +const notifier = new WindowsToaster({ withFallback: true }); //store song controls reference on launch let controls; @@ -17,11 +20,11 @@ module.exports = (win, unpauseNotification) => { // Register songInfoCallback registerCallback(songInfo => { - if (!songInfo.isPaused && (songInfo.url !== currentUrl || notificationOnUnpause)) { + if (!songInfo.isPaused && (songInfo.url !== currentUrl || notificationOnUnpause)) { currentUrl = songInfo.url; sendToaster(songInfo); - } - }); + } + }); win.webContents.once("closed", () => { deleteNotification() @@ -48,7 +51,7 @@ function sendToaster(songInfo) { //download image and get path let imgSrc = notificationImage(songInfo, true); toDelete = { - //app id undefined - will break buttons + appID: is.dev() ? undefined : "com.github.th-ch.youtube-music", title: songInfo.title || "Playing", message: songInfo.artist, id: parseInt(Math.random() * 1000000, 10),