diff --git a/src/main/plugins/playbackNotifications.ts b/src/main/plugins/playbackNotifications.ts index 93806e60..12a5762c 100644 --- a/src/main/plugins/playbackNotifications.ts +++ b/src/main/plugins/playbackNotifications.ts @@ -24,7 +24,24 @@ export default class playbackNotifications { if (this._notification) { this._notification.close(); } - fetch(a.artwork.url.replace('/{w}x{h}bb', '/512x512bb').replace('/2000x2000bb', '/35x35bb')).then(async blob => { + const artworkUrl = a.artwork.url.replace('/{w}x{h}bb', '/512x512bb').replace('/2000x2000bb', '/35x35bb') + console.log(artworkUrl) + const toastXML = ` + + + + + ${a?.name.replace(/&/g, '&')} + ${a?.artistName.replace(/&/g, '&')} — ${a?.albumName.replace(/&/g, '&')} + + + + + + + ` + console.log(toastXML) + fetch(artworkUrl).then(async blob => { const artworkImage = nativeImage.createFromBuffer(Buffer.from(await blob.arrayBuffer())); this._notification = new Notification({ title: a.name, @@ -42,19 +59,7 @@ export default class playbackNotifications { 'text': 'Next' } ], - toastXml: ` - - - ${a.name ?? ''} - ${a.artistName ?? ''} - ${a.albumName ?? '' - } - - - - - - - ` + toastXml: toastXML }); this._notification.on('click', (event: any) => { this._utils.getWindow().show()