@@ -24,7 +24,7 @@
:type="item.type">
+ @click="getContextMenu(item)"><%- include("../svg/more.svg") %>
@@ -84,7 +84,7 @@
addedToLibrary: false,
guid: this.uuidv4(),
noplay: ["apple-curators", "editorial-elements"],
- nomenu: ["artists", "stations", "apple-curators", "editorial-elements"],
+ nomenu: ["stations", "apple-curators", "editorial-elements"],
app: this.$root,
badges: this.$root.socialBadges.badgeMap,
itemBadges: [],
@@ -108,6 +108,14 @@
let color = `#${(this.item.attributes.artwork != null && this.item.attributes.artwork.bgColor != null) ? (this.item.attributes.artwork.bgColor) : ``}`
return color
},
+ getContextMenu(item) {
+ console.log(item)
+ if (item.type == "artists") {
+ return this.artistMenu(item)
+ } else {
+ return this.contextMenu(item)
+ }
+ },
getSubtitle() {
if(this.kind == 'card') {
try {
@@ -500,6 +508,60 @@
}
}
},
+ async artistMenu (event) {
+ let self = this
+ let followAction = "follow"
+ let followActions = {
+ follow: {
+ icon: "./assets/feather/plus-circle.svg",
+ name: app.getLz('action.follow'),
+ action: ()=>{
+ self.app.cfg.home.followedArtists.push(event.id)
+ }
+ },
+ unfollow: {
+ icon: "./assets/feather/x-circle.svg",
+ name: app.getLz('action.unfollow'),
+ action: ()=>{
+ let index = self.app.cfg.home.followedArtists.indexOf(event.id)
+ if (index > -1) {
+ self.app.cfg.home.followedArtists.splice(index, 1)
+ }
+ }
+ }
+ }
+ if(self.app.cfg.home.followedArtists.includes(event.id)) {
+ followAction = "unfollow"
+ }
+ app.showMenuPanel({
+ items: [
+ {
+ icon: "./assets/feather/play.svg",
+ name: app.getLz('action.startRadio'),
+ action: ()=>{
+ app.mk.setStationQueue({artist:event.id}).then(()=>{
+ app.mk.play()
+ })
+ }
+ },
+ followActions[followAction],
+ {
+ icon: "./assets/feather/share.svg",
+ name: app.getLz('term.share'),
+ action: ()=>{
+ self.app.copyToClipboard(event.attributes.url)
+ }
+ },
+ {
+ icon: "./assets/feather/external-link.svg",
+ name: app.getLz('action.openArtworkInBrowser'),
+ action: ()=>{
+ window.open(app.getMediaItemArtwork(this.getArtworkUrl(), 1024, 1024))
+ }
+ }
+ ]
+ }, event)
+ },
},
beforeDestroy: function () {
// this.item = null;