From f50c2d30493196071b6658146ed3b8624bc86bac Mon Sep 17 00:00:00 2001 From: cutls Date: Sat, 12 Oct 2019 01:33:40 +0900 Subject: [PATCH] fix np on macos --- app/js/ui/spotify.js | 4 ++-- app/main/np.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/js/ui/spotify.js b/app/js/ui/spotify.js index beb5fc79..0d73e9cd 100644 --- a/app/js/ui/spotify.js +++ b/app/js/ui/spotify.js @@ -134,8 +134,8 @@ function npCore(arg) { media(arg.path, "image/png", "new"); } } else if (platform == "darwin") { - if (flag && arg.existsArtwork) { - media(arg.artworks[0].data, "image/png", "new"); + if (flag && arg.artwork) { + media(arg.artwork, "image/png", "new"); } } var regExp = new RegExp("{song}", "g"); diff --git a/app/main/np.js b/app/main/np.js index 01f1c067..d8146de3 100644 --- a/app/main/np.js +++ b/app/main/np.js @@ -15,10 +15,11 @@ function np(mainWindow) { if (platform == "darwin") { try { const nowplaying = require("itunes-nowplaying-mac"); - const value = await nowplaying(); + let value = await nowplaying(); const artwork = await nowplaying.getThumbnailBuffer(value.databaseID); - console.log(artwork) + const base64 = artwork.toString('base64'); + value.artwork = base64 e.sender.webContents.send('itunes-np', value); } catch (error) { // エラーを返す