From 4f84ad6c912ad8e2449bfb45a15178a4afb7f689 Mon Sep 17 00:00:00 2001 From: cutls Date: Thu, 23 Jan 2020 00:51:50 +0900 Subject: [PATCH] wip --- app/main/np.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/app/main/np.js b/app/main/np.js index 1dc02d05..45380753 100644 --- a/app/main/np.js +++ b/app/main/np.js @@ -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) { - + console.rrror(error) } } else { }