rpc library images ( need api to work first)

This commit is contained in:
vapormusic 2022-02-13 00:07:16 +07:00
parent 802436e875
commit 2336b85291
4 changed files with 21 additions and 16 deletions

View file

@ -746,7 +746,7 @@ const app = new Vue({
previewURL = app.mk.nowPlayingItem.previewURL
} catch (e) {
}
if (!previewURL) {
if (previewURL == null && ((app.mk.nowPlayingItem?._songId ?? (app.mk.nowPlayingItem["songId"] ?? app.mk.nowPlayingItem.relationships.catalog.data[0].id)) != -1)) {
app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/songs/${app.mk.nowPlayingItem?._songId ?? (app.mk.nowPlayingItem["songId"] ?? app.mk.nowPlayingItem.relationships.catalog.data[0].id)}`).then((response) => {
previewURL = response.data.data[0].attributes.previews[0].url
if (previewURL)

View file

@ -124,7 +124,7 @@
return
}
this.$root.inLibrary([this.item]).then(res => {
this.addedToLibrary = res[0].attributes.inLibrary
this.addedToLibrary = res[0]?.attributes?.inLibrary ?? false
})
return this.addedToLibrary
},