feat(frontend): add ShowSummary, SeasonSummary types + library shows/seasons API methods

This commit is contained in:
2026-03-20 01:14:43 +01:00
parent 23722a771b
commit dd69470ee4
3 changed files with 36 additions and 0 deletions

View File

@@ -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: {