Change to pass error on itunes-np

This commit is contained in:
kPherox 2019-04-14 01:32:16 +09:00
parent 5a03df6ee9
commit efac88db4c
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D
2 changed files with 7 additions and 2 deletions

View File

@ -129,6 +129,10 @@ function nowplaying(mode){
ipc.send('itunes', "");
ipc.once('itunes-np', function (event, arg) {
if (arg.cmd) {
console.error(arg);
return;
}
console.log(arg);
var content=localStorage.getItem("np-temp");
if(!content || content=="" || content=="null"){

View File

@ -29,8 +29,9 @@ function np(mainWindow){
nowplaying.getRawData().then(function (value) {
mainWindow.webContents.send('itunes-np', value);
}).catch(function (error) {
// 非同期処理失敗。呼ばれない
console.log(error);
// エラーを返す
console.error(error);
mainWindow.webContents.send('itunes-np', error);
});
}else{
var {NowPlaying,PlayerName} = require("nowplaying-node");