Change to pass error on itunes-np
This commit is contained in:
		| @@ -129,6 +129,10 @@ function nowplaying(mode){ | |||||||
|  |  | ||||||
| 	    ipc.send('itunes', ""); | 	    ipc.send('itunes', ""); | ||||||
| 	    ipc.once('itunes-np', function (event, arg) { | 	    ipc.once('itunes-np', function (event, arg) { | ||||||
|  |             if (arg.cmd) { | ||||||
|  |               console.error(arg); | ||||||
|  |               return; | ||||||
|  |             } | ||||||
|             console.log(arg); |             console.log(arg); | ||||||
|             var content=localStorage.getItem("np-temp"); |             var content=localStorage.getItem("np-temp"); | ||||||
|             if(!content || content=="" || content=="null"){ |             if(!content || content=="" || content=="null"){ | ||||||
|   | |||||||
| @@ -29,8 +29,9 @@ function np(mainWindow){ | |||||||
|             nowplaying.getRawData().then(function (value) { |             nowplaying.getRawData().then(function (value) { | ||||||
|                 mainWindow.webContents.send('itunes-np', value); |                 mainWindow.webContents.send('itunes-np', value); | ||||||
|             }).catch(function (error) { |             }).catch(function (error) { | ||||||
|                 // 非同期処理失敗。呼ばれない |                 // エラーを返す | ||||||
|                 console.log(error); |                 console.error(error); | ||||||
|  |                 mainWindow.webContents.send('itunes-np', error); | ||||||
|             }); |             }); | ||||||
|             }else{ |             }else{ | ||||||
|                 var {NowPlaying,PlayerName} = require("nowplaying-node"); |                 var {NowPlaying,PlayerName} = require("nowplaying-node"); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	