mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
add featured artists in albumview
This commit is contained in:
@@ -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,
|
||||
};
|
||||
@@ -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;
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user