Refac move PlaylistType into loader and fix new response type

This commit is contained in:
MerlinScheurer
2025-02-16 13:19:21 +01:00
parent a0f31a831f
commit 8a08e7dcca
7 changed files with 36 additions and 37 deletions

View File

@@ -1,6 +1,32 @@
import APIClient from '../../functions/APIClient';
const loadPlaylistById = async (playlistId: string | undefined) => {
export type PlaylistEntryType = {
youtube_id: string;
title: string;
uploader: string;
idx: number;
downloaded: boolean;
};
export type PlaylistType = {
playlist_active: boolean;
playlist_channel: string;
playlist_channel_id: string;
playlist_description: string;
playlist_entries: PlaylistEntryType[];
playlist_id: string;
playlist_last_refresh: string;
playlist_name: string;
playlist_subscribed: boolean;
playlist_thumbnail: string;
playlist_type: string;
_index: string;
_score: number;
};
export type PlaylistResponseType = PlaylistType;
const loadPlaylistById = async (playlistId: string | undefined): Promise<PlaylistResponseType> => {
return APIClient(`/api/playlist/${playlistId}/`);
};