untied current artwork from lcd artwork
This commit is contained in:
parent
96a333ee91
commit
24fbfb6dc4
2 changed files with 7 additions and 2 deletions
|
@ -187,6 +187,7 @@ const app = new Vue({
|
||||||
playerReady: false,
|
playerReady: false,
|
||||||
animateBackground: false,
|
animateBackground: false,
|
||||||
currentArtUrl: '',
|
currentArtUrl: '',
|
||||||
|
currentArtUrlRaw: '',
|
||||||
lyricon: false,
|
lyricon: false,
|
||||||
currentTrackID: '',
|
currentTrackID: '',
|
||||||
currentTrackIDBG: '',
|
currentTrackIDBG: '',
|
||||||
|
@ -3372,7 +3373,9 @@ const app = new Vue({
|
||||||
artworkSize = app.getThemeDirective("lcdArtworkSize")
|
artworkSize = app.getThemeDirective("lcdArtworkSize")
|
||||||
}
|
}
|
||||||
this.currentArtUrl = '';
|
this.currentArtUrl = '';
|
||||||
|
this.currentArtUrlRaw = '';
|
||||||
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.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);
|
||||||
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}")`);
|
||||||
|
@ -3382,6 +3385,7 @@ const app = new Vue({
|
||||||
let data = await this.mk.api.v3.music(`/v1/me/library/songs/${this.mk.nowPlayingItem.id}`);
|
let data = await this.mk.api.v3.music(`/v1/me/library/songs/${this.mk.nowPlayingItem.id}`);
|
||||||
data = data.data.data[0];
|
data = data.data.data[0];
|
||||||
if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) {
|
if (data != null && data !== "" && data.attributes != null && data.attributes.artwork != null) {
|
||||||
|
this.currentArtUrlRaw = (this.mk["nowPlayingItem"]["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);
|
||||||
ipcRenderer.send('updateRPCImage', this.currentArtUrl ?? '');
|
ipcRenderer.send('updateRPCImage', this.currentArtUrl ?? '');
|
||||||
try {
|
try {
|
||||||
|
@ -3389,6 +3393,7 @@ const app = new Vue({
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
this.currentArtUrlRaw = ''
|
||||||
this.currentArtUrl = '';
|
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}")`);
|
||||||
|
|
|
@ -47,13 +47,13 @@
|
||||||
</transition>
|
</transition>
|
||||||
<transition name="fsModeSwitch">
|
<transition name="fsModeSwitch">
|
||||||
<div class="fullscreen-view-container" v-if="appMode == 'fullscreen'">
|
<div class="fullscreen-view-container" v-if="appMode == 'fullscreen'">
|
||||||
<fullscreen-view :image="currentArtUrl.replace('50x50', '600x600')" :time="lyriccurrenttime"
|
<fullscreen-view :image="currentArtUrlRaw" :time="lyriccurrenttime"
|
||||||
:lyrics="lyrics" :richlyrics="richlyrics"></fullscreen-view>
|
:lyrics="lyrics" :richlyrics="richlyrics"></fullscreen-view>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
<transition name="fsModeSwitch">
|
<transition name="fsModeSwitch">
|
||||||
<div class="fullscreen-view-container" v-if="appMode == 'mini'">
|
<div class="fullscreen-view-container" v-if="appMode == 'mini'">
|
||||||
<mini-view :image="currentArtUrl.replace('50x50', '600x600')" :time="lyriccurrenttime"
|
<mini-view :image="currentArtUrlRaw" :time="lyriccurrenttime"
|
||||||
:lyrics="lyrics" :richlyrics="richlyrics"></mini-view>
|
:lyrics="lyrics" :richlyrics="richlyrics"></mini-view>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue