add new album header

This commit is contained in:
geoffrey45
2022-02-19 18:43:17 +03:00
parent dcfb0a6ed1
commit a6bb5059b0
18 changed files with 101 additions and 189 deletions
+35 -34
View File
@@ -4,40 +4,41 @@ import album from "./album.js";
import state from "./state.js";
async function toAlbum(title, artist) {
state.loading.value = true;
album
.getAlbumTracks(title, artist)
.then((data) => {
state.album_song_list.value = data.songs;
state.album_info.value = data.info;
})
.then(
await album.getAlbumArtists(title, artist).then((data) => {
state.album_artists.value = data;
})
)
.then(
await album.getAlbumBio(title, artist).then((data) => {
if (data === "None") {
state.album_bio.value = null;
} else {
state.album_bio.value = data;
}
})
)
.then(() => {
Router.push({
name: "AlbumView",
params: {
album: title,
artist: artist,
},
});
state.loading.value = false;
})
.catch((error) => {
console.log(error);
});
console.log("routing to album");
state.loading.value = true;
await album
.getAlbumTracks(title, artist)
.then((data) => {
state.album_song_list.value = data.songs;
state.album_info.value = data.info;
})
.then(
await album.getAlbumArtists(title, artist).then((data) => {
state.album_artists.value = data;
})
)
.then(
album.getAlbumBio(title, artist).then((data) => {
if (data === "None") {
state.album_bio.value = null;
} else {
state.album_bio.value = data;
}
})
)
.then(() => {
Router.push({
name: "AlbumView",
params: {
album: title,
artist: artist,
},
});
state.loading.value = false;
})
.catch((error) => {
console.log(error);
});
}
export default {