prevent type coercion

- remove unused imports
- minor refactors and cleanups
This commit is contained in:
geoffrey45
2022-02-16 15:06:29 +03:00
parent 9972caf7d3
commit 5446b1fe4b
26 changed files with 190 additions and 206 deletions
+35 -35
View File
@@ -3,41 +3,41 @@ import Router from "@/router";
import album from "./album.js";
import state from "./state.js";
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(
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);
});
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);
});
}
export default {