fix for library artists

This commit is contained in:
booploops 2022-02-24 05:24:04 -08:00
parent 9b05cde0d2
commit ae9669c3f9
4 changed files with 45 additions and 17 deletions

View file

@ -221,7 +221,7 @@
itemBadges: [],
badgesRequested: false,
headerVisible: true,
useArtistChip: false
useArtistChip: false,
}
},
mounted: function () {
@ -414,6 +414,15 @@
},
menu(event) {
let self = this
let artistId = null
if(typeof this.data.relationships.artists != "undefined") {
artistId = this.data.relationships.artists.data[0].id
if(this.data.relationships.artists.data[0].type == "library-artists") {
artistId = this.data.relationships.artists.data[0].relationships.catalog.data[0].id
}
}
let menuItems = {
items: {
"share": {
@ -449,7 +458,7 @@
icon: "./assets/feather/plus-circle.svg",
hidden: false,
action: () => {
app.followArtistById(this.data.relationships.artists.data[0].id, true)
app.followArtistById(artistId, true)
}
},
"unfollow": {
@ -457,13 +466,14 @@
icon: "./assets/feather/x-circle.svg",
hidden: true,
action: () => {
app.followArtistById(this.data.relationships.artists.data[0].id, false)
app.followArtistById(artistId, false)
}
},
}
}
if(typeof this.data.relationships.artists != "undefined") {
if(app.followingArtist(this.data.relationships.artists.data[0].id)){
if(artistId != null) {
if(app.followingArtist(artistId)){
menuItems.items.follow.hidden = true
menuItems.items.unfollow.hidden = false
} else {
@ -475,6 +485,7 @@
menuItems.items.unfollow.hidden = true
}
app.showMenuPanel(menuItems, event)
},