diff --git a/src/renderer/views/pages/cider-playlist.ejs b/src/renderer/views/pages/cider-playlist.ejs index aa811295..27229fdf 100644 --- a/src/renderer/views/pages/cider-playlist.ejs +++ b/src/renderer/views/pages/cider-playlist.ejs @@ -413,6 +413,7 @@ }) }, menu(event) { + let self = this let menuItems = { items: { "share": { @@ -448,7 +449,7 @@ icon: "./assets/feather/plus-circle.svg", hidden: false, action: () => { - app.followArtistById(this.data.id, true) + app.followArtistById(this.data.relationships.artists.data[0].id, true) } }, "unfollow": { @@ -456,18 +457,24 @@ icon: "./assets/feather/x-circle.svg", hidden: true, action: () => { - app.followArtistById(this.data.id, false) + app.followArtistById(this.data.relationships.artists.data[0].id, false) } }, } } - if(app.followingArtist(this.data.id)){ + if(typeof this.data.relationships.artists != "undefined") { + if(app.followingArtist(this.data.relationships.artists.data[0].id)){ + menuItems.items.follow.hidden = true + menuItems.items.unfollow.hidden = false + } else { + menuItems.items.follow.hidden = false + menuItems.items.unfollow.hidden = true + } + }else{ menuItems.items.follow.hidden = true - menuItems.items.unfollow.hidden = false - } else { - menuItems.items.follow.hidden = false menuItems.items.unfollow.hidden = true } + app.showMenuPanel(menuItems, event) }, diff --git a/src/renderer/views/pages/playlist-inline.ejs b/src/renderer/views/pages/playlist-inline.ejs index d0272b6a..520aaf4a 100644 --- a/src/renderer/views/pages/playlist-inline.ejs +++ b/src/renderer/views/pages/playlist-inline.ejs @@ -437,6 +437,7 @@ }) }, menu(event) { + let self = this let menuItems = { items: { "share": { @@ -472,7 +473,7 @@ icon: "./assets/feather/plus-circle.svg", hidden: false, action: () => { - app.followArtistById(this.data.id, true) + app.followArtistById(this.data.relationships.artists.data[0].id, true) } }, "unfollow": { @@ -480,20 +481,27 @@ icon: "./assets/feather/x-circle.svg", hidden: true, action: () => { - app.followArtistById(this.data.id, false) + app.followArtistById(this.data.relationships.artists.data[0].id, false) } }, } } - if(app.followingArtist(this.data.id)){ + if(typeof this.data.relationships.artists != "undefined") { + if(app.followingArtist(this.data.relationships.artists.data[0].id)){ + menuItems.items.follow.hidden = true + menuItems.items.unfollow.hidden = false + } else { + menuItems.items.follow.hidden = false + menuItems.items.unfollow.hidden = true + } + }else{ menuItems.items.follow.hidden = true - menuItems.items.unfollow.hidden = false - } else { - menuItems.items.follow.hidden = false menuItems.items.unfollow.hidden = true } + app.showMenuPanel(menuItems, event) + }, getItemParent: function (data) { kind = data.attributes.playParams.kind;