This commit is contained in:
cutls 2020-01-12 20:42:23 +09:00
parent ee7ca45b91
commit 8f85016d8c

View File

@ -16,12 +16,10 @@ function np(mainWindow) {
try { try {
const nowplaying = require('itunes-nowplaying-mac') const nowplaying = require('itunes-nowplaying-mac')
let value = await nowplaying() let value = await nowplaying()
if (!value && npExec) { const artwork = await nowplaying.getThumbnailBuffer(value.databaseID)
const artwork = await nowplaying.getThumbnailBuffer(value.databaseID) const base64 = artwork.toString('base64')
const base64 = artwork.toString('base64') value.artwork = base64
value.artwork = base64 e.sender.webContents.send('itunes-np', value)
e.sender.webContents.send('itunes-np', value)
}
} catch (error) { } catch (error) {
// エラーを返す // エラーを返す
console.error(error) console.error(error)