From d654b63bca1159c275b36d8f9022390550b8658e Mon Sep 17 00:00:00 2001 From: cutls Date: Sat, 12 Oct 2019 01:08:33 +0900 Subject: [PATCH] Fix: macOS NP --- app/js/ui/spotify.js | 6 +++++- app/main/np.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/js/ui/spotify.js b/app/js/ui/spotify.js index 8d0e149d..beb5fc79 100644 --- a/app/js/ui/spotify.js +++ b/app/js/ui/spotify.js @@ -141,7 +141,11 @@ function npCore(arg) { var regExp = new RegExp("{song}", "g"); content = content.replace(regExp, arg.name); var regExp = new RegExp("{album}", "g"); - content = content.replace(regExp, arg.album); + if(arg.album){ + if(arg.album.name){ + content = content.replace(regExp, arg.album.name); + } + } var regExp = new RegExp("{artist}", "g"); content = content.replace(regExp, arg.artist); var regExp = new RegExp("{url}", "g"); diff --git a/app/main/np.js b/app/main/np.js index 00ff39ba..12055816 100644 --- a/app/main/np.js +++ b/app/main/np.js @@ -15,7 +15,7 @@ function np(mainWindow) { if (platform == "darwin") { try { const nowplaying = require("itunes-nowplaying-mac"); - const value = await nowplaying.getRawData(); + const value = await nowplaying.getData(); e.sender.webContents.send('itunes-np', value); } catch (error) { // エラーを返す