mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 12:33:03 +00:00
🔷 add PlayingFrom component to right sidebar
🔷 move upNext card into separate component 🔷 a lot of refactors
This commit is contained in:
@@ -10,3 +10,10 @@ export enum NotifType {
|
||||
Info,
|
||||
Error,
|
||||
}
|
||||
|
||||
export enum FromOptions {
|
||||
playlist = "playlist",
|
||||
folder = "folder",
|
||||
album = "album",
|
||||
search = "search",
|
||||
}
|
||||
|
||||
@@ -95,12 +95,16 @@ async function getPTracks(playlistid: string) {
|
||||
async function getPlaylist(pid: string) {
|
||||
const uri = state.settings.uri + "/playlist/" + pid;
|
||||
|
||||
let playlist: Playlist;
|
||||
let playlist = {
|
||||
info: {},
|
||||
tracks: <Track[]>[],
|
||||
};
|
||||
|
||||
await axios
|
||||
.get(uri)
|
||||
.then((res) => {
|
||||
playlist = res.data.data;
|
||||
playlist.info = res.data.info;
|
||||
playlist.tracks = res.data.tracks;
|
||||
})
|
||||
.catch((err) => {
|
||||
new Notification("Something funny happened!", NotifType.Error);
|
||||
@@ -110,4 +114,10 @@ async function getPlaylist(pid: string) {
|
||||
return playlist;
|
||||
}
|
||||
|
||||
export { createNewPlaylist, getAllPlaylists, addTrackToPlaylist, getPTracks, getPlaylist };
|
||||
export {
|
||||
createNewPlaylist,
|
||||
getAllPlaylists,
|
||||
addTrackToPlaylist,
|
||||
getPTracks,
|
||||
getPlaylist,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user