From d742a110cadf87e73fdcf1a35e53276615cf4b36 Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Wed, 1 Jun 2022 23:26:04 -0700 Subject: [PATCH] faster nowplaying artwork --- src/renderer/main/vueapp.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/renderer/main/vueapp.js b/src/renderer/main/vueapp.js index 7750a74e..bb0e2ceb 100644 --- a/src/renderer/main/vueapp.js +++ b/src/renderer/main/vueapp.js @@ -3783,6 +3783,9 @@ const app = new Vue({ if (app.mk.nowPlayingItem != null && app.mk.nowPlayingItem.attributes != null && app.mk.nowPlayingItem.attributes.artwork != null && app.mk.nowPlayingItem.attributes.artwork.url != null && app.mk.nowPlayingItem.attributes.artwork.url != '') { this.currentArtUrlRaw = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ?? '') this.currentArtUrl = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ?? '').replace('{w}', artworkSize).replace('{h}', artworkSize); + if(this.mk.nowPlayingItem._assets[0].artworkURL) { + this.currentArtUrl = this.mk.nowPlayingItem._assets[0].artworkURL + } try { document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`); } catch (e) { @@ -3793,6 +3796,9 @@ const app = new Vue({ if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) { this.currentArtUrlRaw = (data["attributes"]["artwork"]["url"] ?? '') this.currentArtUrl = (data["attributes"]["artwork"]["url"] ?? '').replace('{w}', artworkSize).replace('{h}', artworkSize); + if(this.mk.nowPlayingItem._assets[0].artworkURL) { + this.currentArtUrl = this.mk.nowPlayingItem._assets[0].artworkURL + } ipcRenderer.send('updateRPCImage', this.currentArtUrl ?? ''); try { document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);