mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-10 18:21:47 +00:00
Merge pull request #591 from Araxeus/update-snoretoast
fix interactive notifications icon + exclude platform specific plugins from build
This commit is contained in:
@ -15,6 +15,7 @@
|
|||||||
"productName": "YouTube Music",
|
"productName": "YouTube Music",
|
||||||
"mac": {
|
"mac": {
|
||||||
"identity": null,
|
"identity": null,
|
||||||
|
"files": ["!plugins/taskbar-mediacontrol${/*}"],
|
||||||
"target": [
|
"target": [
|
||||||
{
|
{
|
||||||
"target": "dmg",
|
"target": "dmg",
|
||||||
@ -28,6 +29,7 @@
|
|||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
"icon": "assets/generated/icons/win/icon.ico",
|
"icon": "assets/generated/icons/win/icon.ico",
|
||||||
|
"files": ["!plugins/touchbar${/*}"],
|
||||||
"target": [
|
"target": [
|
||||||
"nsis",
|
"nsis",
|
||||||
"portable"
|
"portable"
|
||||||
@ -38,6 +40,7 @@
|
|||||||
},
|
},
|
||||||
"linux": {
|
"linux": {
|
||||||
"icon": "assets/generated/icons/png",
|
"icon": "assets/generated/icons/png",
|
||||||
|
"files": ["!plugins/{touchbar,taskbar-mediacontrol}${/*}"],
|
||||||
"category": "AudioVideo",
|
"category": "AudioVideo",
|
||||||
"target": [
|
"target": [
|
||||||
"AppImage",
|
"AppImage",
|
||||||
|
|||||||
@ -3,8 +3,6 @@ const is = require("electron-is");
|
|||||||
const registerCallback = require("../../providers/song-info");
|
const registerCallback = require("../../providers/song-info");
|
||||||
const { notificationImage } = require("./utils");
|
const { notificationImage } = require("./utils");
|
||||||
|
|
||||||
const setupInteractive = require("./interactive")
|
|
||||||
|
|
||||||
const notify = (info, options) => {
|
const notify = (info, options) => {
|
||||||
|
|
||||||
// Fill the notification with content
|
// Fill the notification with content
|
||||||
@ -41,6 +39,6 @@ const setup = (options) => {
|
|||||||
module.exports = (win, options) => {
|
module.exports = (win, options) => {
|
||||||
// Register the callback for new song information
|
// Register the callback for new song information
|
||||||
is.windows() && options.interactive ?
|
is.windows() && options.interactive ?
|
||||||
setupInteractive(win, options.unpauseNotification) :
|
require("./interactive")(win, options.unpauseNotification) :
|
||||||
setup(options);
|
setup(options);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,10 @@
|
|||||||
const { notificationImage, icons } = require("./utils");
|
const { notificationImage, icons } = require("../utils");
|
||||||
const getSongControls = require('../../providers/song-controls');
|
const getSongControls = require('../../../providers/song-controls');
|
||||||
const registerCallback = require("../../providers/song-info");
|
const registerCallback = require("../../../providers/song-info");
|
||||||
const notifier = require("node-notifier");
|
const is = require("electron-is");
|
||||||
|
const WindowsToaster = require('node-notifier').WindowsToaster;
|
||||||
|
|
||||||
|
const notifier = new WindowsToaster({ withFallback: true });
|
||||||
|
|
||||||
//store song controls reference on launch
|
//store song controls reference on launch
|
||||||
let controls;
|
let controls;
|
||||||
@ -17,11 +20,11 @@ module.exports = (win, unpauseNotification) => {
|
|||||||
|
|
||||||
// Register songInfoCallback
|
// Register songInfoCallback
|
||||||
registerCallback(songInfo => {
|
registerCallback(songInfo => {
|
||||||
if (!songInfo.isPaused && (songInfo.url !== currentUrl || notificationOnUnpause)) {
|
if (!songInfo.isPaused && (songInfo.url !== currentUrl || notificationOnUnpause)) {
|
||||||
currentUrl = songInfo.url;
|
currentUrl = songInfo.url;
|
||||||
sendToaster(songInfo);
|
sendToaster(songInfo);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
win.webContents.once("closed", () => {
|
win.webContents.once("closed", () => {
|
||||||
deleteNotification()
|
deleteNotification()
|
||||||
@ -48,7 +51,7 @@ function sendToaster(songInfo) {
|
|||||||
//download image and get path
|
//download image and get path
|
||||||
let imgSrc = notificationImage(songInfo, true);
|
let imgSrc = notificationImage(songInfo, true);
|
||||||
toDelete = {
|
toDelete = {
|
||||||
//app id undefined - will break buttons
|
appID: is.dev() ? undefined : "com.github.th-ch.youtube-music",
|
||||||
title: songInfo.title || "Playing",
|
title: songInfo.title || "Playing",
|
||||||
message: songInfo.artist,
|
message: songInfo.artist,
|
||||||
id: parseInt(Math.random() * 1000000, 10),
|
id: parseInt(Math.random() * 1000000, 10),
|
||||||
|
|||||||
Reference in New Issue
Block a user