mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 13:03:02 +00:00
add functionality to play button on artist page
This commit is contained in:
committed by
Mungai Njoroge
parent
bb95011dff
commit
90dd1a1fe8
@@ -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 = [];
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user