Fix: #108 NowPlaying of iTunes on macOS

This commit is contained in:
Cutls 2019-08-23 02:00:22 +09:00
parent d0ed9faf50
commit 61d4d7005e
2 changed files with 5 additions and 7 deletions

View File

@ -45,12 +45,8 @@ onmessage = function (e) {
} else if (e.data[0] == "aboutData") { } else if (e.data[0] == "aboutData") {
ipc.send('aboutData', ""); ipc.send('aboutData', "");
} else if (e.data[0] == "itunes") { } else if (e.data[0] == "itunes") {
console.log("NowPlaying" + ipc.listenerCount('itunes-np')) console.log("NowPlaying")
if (ipc.listenerCount('itunes-np') > 1) { ipc.send("itunes", e.data[1])
return false;
} else {
ipc.send("itunes", e.data[1])
}
} else if (e.data[0] == "themeCSSRequest") { } else if (e.data[0] == "themeCSSRequest") {
ipc.send('theme-css-request', e.data[1]); ipc.send('theme-css-request', e.data[1]);
} else if (e.data[0] == "downloadButton") { } else if (e.data[0] == "downloadButton") {
@ -148,7 +144,7 @@ ipc.on('theme-json-create-complete', function (event, args) {
postMessage(["ctLoad", ""], "*") postMessage(["ctLoad", ""], "*")
}); });
//spotify.js //spotify.js
ipc.once('itunes-np', function (event, arg) { ipc.on('itunes-np', function (event, arg) {
postMessage(["npCore", arg], "*") postMessage(["npCore", arg], "*")
}) })
//tips.js //tips.js

View File

@ -22,6 +22,8 @@ function np(mainWindow) {
console.error(error); console.error(error);
e.sender.webContents.send('itunes-np', error); e.sender.webContents.send('itunes-np', error);
} }
} else {
} }
} }