add functionality to play button on artist page

This commit is contained in:
geoffrey45
2022-12-06 23:29:14 +03:00
committed by Mungai Njoroge
parent bb95011dff
commit 90dd1a1fe8
12 changed files with 145 additions and 43 deletions
+18 -5
View File
@@ -7,8 +7,10 @@ import { maxAbumCards } from "@/stores/content-width";
export default defineStore("artistPage", {
state: () => ({
info: <Artist>{},
albums: <Album[]>[],
tracks: <Track[]>[],
albums: <Album[]>[],
eps: <Album[]>[],
singles: <Album[]>[],
}),
actions: {
async getData(hash: string) {
@@ -18,17 +20,28 @@ export default defineStore("artistPage", {
this.tracks = tracks;
},
async getArtistAlbums() {
const albums = await getArtistAlbums(
const { albums, eps, singles } = await getArtistAlbums(
this.info.artisthash,
maxAbumCards.value
);
if (albums.length > 0) {
this.albums = albums;
}
this.albums = albums;
this.eps = eps;
this.singles = singles;
// if (albums.length > 0) {
// }
// if (eps.length > 0) {
// }
// if (singles.length > 0) {
// }
},
resetAlbums() {
this.albums = [];
this.eps = [];
this.singles = [];
},
},
});