mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
add featured artists to playlist page
+ fetch album bio on raising bottom container
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user