feat(frontend): add ShowSummary, SeasonSummary types + library shows/seasons API methods
This commit is contained in:
@@ -22,6 +22,8 @@ import type {
|
||||
LibrarySyncLogEntry,
|
||||
PagedLibraryResponse,
|
||||
AdminSettings,
|
||||
ShowSummary,
|
||||
SeasonSummary,
|
||||
} from "@/lib/types";
|
||||
|
||||
const API_BASE =
|
||||
@@ -267,6 +269,22 @@ export const api = {
|
||||
params.set('limit', String(filter.limit ?? 50));
|
||||
return request(`/library/items?${params}`, { token });
|
||||
},
|
||||
|
||||
shows: (token: string, filter?: { q?: string; provider?: string; genres?: string[] }): Promise<ShowSummary[]> => {
|
||||
const params = new URLSearchParams();
|
||||
if (filter?.q) params.set('q', filter.q);
|
||||
if (filter?.provider) params.set('provider', filter.provider);
|
||||
filter?.genres?.forEach(g => params.append('genres[]', g));
|
||||
const qs = params.toString();
|
||||
return request(`/library/shows${qs ? `?${qs}` : ''}`, { token });
|
||||
},
|
||||
|
||||
seasons: (token: string, seriesName: string, provider?: string): Promise<SeasonSummary[]> => {
|
||||
const params = new URLSearchParams();
|
||||
if (provider) params.set('provider', provider);
|
||||
const qs = params.toString();
|
||||
return request(`/library/shows/${encodeURIComponent(seriesName)}/seasons${qs ? `?${qs}` : ''}`, { token });
|
||||
},
|
||||
},
|
||||
|
||||
files: {
|
||||
|
||||
Reference in New Issue
Block a user