add featured artists to playlist page

+ fetch album bio on raising bottom container
This commit is contained in:
geoffrey45 committed 2022-07-08 16:39:16 +03:00
1 parent 9d5cbfcc93
commit 09c588c856
15 files changed
+154 -84

No files matched your search

+27
View File
@@ -1,3 +1,4 @@
import { Artist } from "./../../interfaces";
import { Playlist, Track } from "../../interfaces";
import { Notification, NotifType } from "../../stores/notification";
import state from "../state";
@@ -120,6 +121,32 @@ async function updatePlaylist(pid: string, playlist: FormData, pStore: any) {
}
}
/**
* Gets the artists in a playlist.
* @param pid The playlist id to fetch tracks for.
* @returns {Promise<Artist[]>} A promise that resolves to an array of artists.
*/
export async function getPlaylistArtists(pid: string): Promise<Artist[]> {
const uri = state.settings.uri + "/playlist/artists";
const { data, error } = await useAxios({
url: uri,
props: {
pid: pid,
},
});
if (error) {
new Notification("Something funny happened!", NotifType.Error);
}
if (data) {
return data.data as Artist[];
}
return [];
}
export {
createNewPlaylist,
getAllPlaylists,