Fix: WIP: album artworks

This commit is contained in:
cutls 2020-01-23 00:49:36 +09:00
parent bc11e75d79
commit 3fe5676f44

View File

@ -12,13 +12,13 @@ function np(mainWindow) {
const nowplaying = require('itunes-nowplaying-mac') const nowplaying = require('itunes-nowplaying-mac')
let value = await nowplaying() let value = await nowplaying()
const artwork = await nowplaying.getThumbnailBuffer(value.databaseID) const artwork = await nowplaying.getThumbnailBuffer(value.databaseID)
if(artwork) {
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)
e.sender.webContents.send('itunes-np', error)
} }
} else { } else {
} }