This commit is contained in:
cutls 2020-01-23 00:51:50 +09:00
parent 3fe5676f44
commit 4f84ad6c91

View File

@ -11,14 +11,20 @@ function np(mainWindow) {
try {
const nowplaying = require('itunes-nowplaying-mac')
let value = await nowplaying()
const artwork = await nowplaying.getThumbnailBuffer(value.databaseID)
if(artwork) {
const base64 = artwork.toString('base64')
value.artwork = base64
try {
const artwork = await nowplaying.getThumbnailBuffer(value.databaseID)
if(artwork) {
const base64 = artwork.toString('base64')
value.artwork = base64
e.sender.webContents.send('itunes-np', value)
}
} catch (error) {
console.rrror(error)
e.sender.webContents.send('itunes-np', value)
}
e.sender.webContents.send('itunes-np', value)
} catch (error) {
} catch (error) {
console.rrror(error)
}
} else {
}