faster nowplaying artwork
This commit is contained in:
parent
03ece990b4
commit
d742a110ca
1 changed files with 6 additions and 0 deletions
|
@ -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 != '') {
|
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.currentArtUrlRaw = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ?? '')
|
||||||
this.currentArtUrl = (this.mk["nowPlayingItem"]["attributes"]["artwork"]["url"] ?? '').replace('{w}', artworkSize).replace('{h}', artworkSize);
|
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 {
|
try {
|
||||||
document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);
|
document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -3793,6 +3796,9 @@ const app = new Vue({
|
||||||
if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) {
|
if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) {
|
||||||
this.currentArtUrlRaw = (data["attributes"]["artwork"]["url"] ?? '')
|
this.currentArtUrlRaw = (data["attributes"]["artwork"]["url"] ?? '')
|
||||||
this.currentArtUrl = (data["attributes"]["artwork"]["url"] ?? '').replace('{w}', artworkSize).replace('{h}', artworkSize);
|
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 ?? '');
|
ipcRenderer.send('updateRPCImage', this.currentArtUrl ?? '');
|
||||||
try {
|
try {
|
||||||
document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);
|
document.querySelector('.app-playback-controls .artwork').style.setProperty('--artwork', `url("${this.currentArtUrl}")`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue