diff --git a/src/renderer/index.js b/src/renderer/index.js index 365789cc..77aad13e 100644 --- a/src/renderer/index.js +++ b/src/renderer/index.js @@ -1574,6 +1574,19 @@ const app = new Vue({ this.getArtistFromID(id) //this.getTypeFromID("artist",id,isLibrary,query) }, + followArtistById(id, follow) { + if (follow && !this.followingArist(id)) { + this.cfg.home.followedArtists.push(id) + } else { + let index = this.cfg.home.followedArtists.indexOf(this.item.id) + if (index > -1) { + this.cfg.home.followedArtists.splice(index, 1) + } + } + }, + followingArtist(id) { + return this.cfg.home.followedArtists.includes(id) + }, playMediaItem(item) { let kind = (item.attributes.playParams ? (item.attributes.playParams.kind ?? (item.type ?? '')) : (item.type ?? '')); let id = (item.attributes.playParams ? (item.attributes.playParams.id ?? (item.id ?? '')) : (item.id ?? '')); diff --git a/src/renderer/views/components/artist-chip.ejs b/src/renderer/views/components/artist-chip.ejs index 345cbd6e..8a8a7c21 100644 --- a/src/renderer/views/components/artist-chip.ejs +++ b/src/renderer/views/components/artist-chip.ejs @@ -6,8 +6,8 @@
{{ item.attributes.name }}
- - + + @@ -26,24 +26,13 @@ }, template: '#artist-chip', async mounted() { - app.mk.api.v3.music(`/v1/catalog/us/artists/${this.item.id}`).then(response => { + app.mk.api.v3.music(`/v1/catalog/${app.mk.storefrontId}/artists/${this.item.id}`).then(response => { this.artist = response.data.data[0]; }); }, methods: { route() { app.appRoute(`artist/${this.item.id}`); - }, - followArtist () { - app.cfg.home.followedArtists.push(this.item.id) - notyf.success(`You are now following ${this.item.attributes.name}`) - }, - unfollowArtist () { - let index = app.cfg.home.followedArtists.indexOf(this.item.id) - if (index > -1) { - app.cfg.home.followedArtists.splice(index, 1) - } - notyf.success(`You have unfollowed ${this.item.attributes.name}`) } } });