Skip to content

Commit 7192b25

Browse files
authored
Merge pull request #591 from Araxeus/update-snoretoast
fix interactive notifications icon + exclude platform specific plugins from build
2 parents 7f0d623 + 1b99cc6 commit 7192b25

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"productName": "YouTube Music",
1616
"mac": {
1717
"identity": null,
18+
"files": ["!plugins/taskbar-mediacontrol${/*}"],
1819
"target": [
1920
{
2021
"target": "dmg",
@@ -28,6 +29,7 @@
2829
},
2930
"win": {
3031
"icon": "assets/generated/icons/win/icon.ico",
32+
"files": ["!plugins/touchbar${/*}"],
3133
"target": [
3234
"nsis",
3335
"portable"
@@ -38,6 +40,7 @@
3840
},
3941
"linux": {
4042
"icon": "assets/generated/icons/png",
43+
"files": ["!plugins/{touchbar,taskbar-mediacontrol}${/*}"],
4144
"category": "AudioVideo",
4245
"target": [
4346
"AppImage",

plugins/notifications/back.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ const is = require("electron-is");
33
const registerCallback = require("../../providers/song-info");
44
const { notificationImage } = require("./utils");
55

6-
const setupInteractive = require("./interactive")
7-
86
const notify = (info, options) => {
97

108
// Fill the notification with content
@@ -41,6 +39,6 @@ const setup = (options) => {
4139
module.exports = (win, options) => {
4240
// Register the callback for new song information
4341
is.windows() && options.interactive ?
44-
setupInteractive(win, options.unpauseNotification) :
42+
require("./interactive")(win, options.unpauseNotification) :
4543
setup(options);
4644
};

plugins/notifications/interactive.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
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
710
let 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

Comments
 (0)