feat(web): tell pending seasons from settled empty
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user