add featured artists in albumview

This commit is contained in:
geoffrey45
2022-01-15 18:18:55 +03:00
parent 1b9e6821d6
commit a720891c20
13 changed files with 166 additions and 148 deletions
+44
View File
@@ -0,0 +1,44 @@
let base_uri = "http://127.0.0.1:9876";
const getAlbumTracks = async (name, artist) => {
const res = await fetch(
base_uri +
"/albums/" +
encodeURIComponent(name.replaceAll("/", "|")) +
"::" +
encodeURIComponent(artist.replaceAll("/", "|"))
);
if (!res.ok) {
const message = `An error has occured: ${res.status}`;
throw new Error(message);
}
const data = await res.json();
return data;
};
const getAlbumArtists = async (name, artist) => {
const res = await fetch(
base_uri +
"/album/" +
encodeURIComponent(name.replaceAll("/", "|")) +
"/" +
encodeURIComponent(artist.replaceAll("/", "|")) +
"/artists"
);
if (!res.ok) {
const message = `An error has occured: ${res.status}`;
throw new Error(message);
}
const data = await res.json();
return data.artists;
};
export default {
getAlbumTracks,
getAlbumArtists,
};
-16
View File
@@ -1,16 +0,0 @@
let base_uri = "http://127.0.0.1:9876";
const getAlbum = async (name, artist) => {
const res = await fetch(base_uri + "/albums/" + encodeURIComponent(name.replaceAll("/", "|")) + "::" + encodeURIComponent(artist.replaceAll("/", "|")));
if (!res.ok) {
const message = `An error has occured: ${res.status}`;
throw new Error(message);
}
const data = await res.json();
return data;
};
export default getAlbum;
+4 -2
View File
@@ -33,8 +33,9 @@ const prev = ref({
const album_song_list = ref([])
const album_info = ref([])
const album_artists = ref([])
const filters = ref([]);
const magic_flag = ref(false);
const loading = ref(false);
@@ -59,5 +60,6 @@ export default {
search_albums,
search_artists,
album_song_list,
album_info
album_info,
album_artists
};