feat(web): tell pending seasons from settled empty

This commit is contained in:
Miguel Palhas
2026-08-24 18:58:35 +01:00
parent 88a353dc68
commit b2147fe7b9
4 changed files with 225 additions and 4 deletions
+15
View File
@@ -16,6 +16,8 @@ export interface ApiSeries {
year: number | null;
root_id: number;
blocked: boolean;
/** Null until a metadata refresh has stamped it (#160, #177). */
metadata_refreshed_at: string | null;
status: SeriesStatus;
wanted_episodes: number;
available_episodes: number;
@@ -79,6 +81,19 @@ export async function fetchSeasons(seriesId: number): Promise<SeasonsOutcome> {
}
}
/** Issue #177: resend the on-demand refresh a page gave up polling for. */
export async function refreshSeriesMetadata(seriesId: number): Promise<ActionOutcome> {
try {
const response = await fetch(`/api/series/${seriesId}/refresh-metadata`, { method: "POST" });
if (!response.ok) {
return { kind: "error", detail: await errorDetail(response) };
}
return { kind: "done" };
} catch {
return { kind: "error", detail: "daemon unreachable" };
}
}
/** One imported episode file as `/api/series/{id}/files` reports it (§7.4). */
export interface EpisodeFile {
episode_id: number;