Jellyfin: who is watching, and don't update a machine mid-film
New Jellyfin integration (read-only, every 2 minutes): version, restart wanted, streams and transcoding, failed scheduled tasks, item counts, failed sign-ins. Monitoring -> Jellyfin page with a peak-streams history, three alerts, /metrics. When Jellyfin runs on a managed server, an update run asks first if people are streaming (409 "watching" unless startAnyway), and a patch plan waits up to two hours for them before updating that server. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f082ca5c2
commit
0146eb8bca
38 files changed
+8136
-13
No files matched your search
+46
-1
@@ -766,6 +766,8 @@ export interface UpdateRunInput {
|
||||
templateId: number;
|
||||
limit: string;
|
||||
windowMinutes: number;
|
||||
/** Somebody is streaming from the machine and the person has seen the warning. */
|
||||
startAnyway?: boolean;
|
||||
}
|
||||
|
||||
export interface UpdatesServer {
|
||||
@@ -1194,6 +1196,44 @@ export interface MonthlyReport {
|
||||
renewals: { kind: string; subject: string; at: string; fromDate: string; toDate: string }[];
|
||||
}
|
||||
|
||||
/** One Jellyfin, as its page shows it. */
|
||||
export interface JellyfinStream {
|
||||
user: string;
|
||||
client: string | null;
|
||||
device: string | null;
|
||||
title: string;
|
||||
transcoding: boolean;
|
||||
paused: boolean;
|
||||
}
|
||||
|
||||
export interface JellyfinInfo {
|
||||
id: number;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
runsOn: { id: number; name: string } | null;
|
||||
status: { at: string; ok: boolean; error: string | null } | null;
|
||||
fresh: boolean;
|
||||
state: {
|
||||
serverName: string | null;
|
||||
version: string | null;
|
||||
os: string | null;
|
||||
pendingRestart: boolean;
|
||||
updateAvailable: boolean;
|
||||
streams: JellyfinStream[];
|
||||
tasks: { name: string; category: string | null; state: string; lastStatus: string | null; lastEndedAt: string | null; error: string | null }[];
|
||||
counts: { movies: number | null; series: number | null; episodes: number | null; songs: number | null };
|
||||
failedLogins24h: number | null;
|
||||
updatedAt: string;
|
||||
} | null;
|
||||
problems: { key: string; message: string; severity: "warning" | "critical" }[];
|
||||
}
|
||||
|
||||
export interface JellyfinHistory {
|
||||
jellyfin: { id: number; name: string };
|
||||
days: number;
|
||||
points: { t: string; streams: number; transcodes: number }[];
|
||||
}
|
||||
|
||||
/** A check the app could set up for you, from what it already knows. */
|
||||
/** A backup job Duplicati reported, as the page shows it. */
|
||||
export interface DuplicatiBackup {
|
||||
@@ -2108,7 +2148,7 @@ export interface ManualTaskInput {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
export type IntegrationType = "proxmox" | "synology" | "semaphore" | "tailscale" | "gitea" | "dockhand" | "uptimekuma" | "phpipam" | "pbs" | "osticket" | "unifi" | "npm" | "homeassistant" | "ups";
|
||||
export type IntegrationType = "proxmox" | "synology" | "semaphore" | "tailscale" | "gitea" | "dockhand" | "uptimekuma" | "phpipam" | "pbs" | "osticket" | "unifi" | "npm" | "homeassistant" | "ups" | "jellyfin";
|
||||
|
||||
export interface IntegrationField {
|
||||
key: string;
|
||||
@@ -2655,6 +2695,11 @@ export const api = {
|
||||
update: (id: number, data: ServiceLevelInput) => request<{ ok: boolean }>(`/api/service-levels/${id}`, { method: "PUT", body: JSON.stringify(data) }),
|
||||
remove: (id: number) => request<void>(`/api/service-levels/${id}`, { method: "DELETE" }),
|
||||
},
|
||||
jellyfin: {
|
||||
list: () => request<{ jellyfins: JellyfinInfo[] }>("/api/jellyfin"),
|
||||
history: (id: number, days: number) => request<JellyfinHistory>(`/api/jellyfin/${id}/history?days=${days}`),
|
||||
watching: (serverId: number) => request<{ watching: { integrationId: number; integrationName: string; streams: JellyfinStream[] }[]; words: string }>(`/api/jellyfin/watching?serverId=${serverId}`),
|
||||
},
|
||||
ups: {
|
||||
list: () => request<{ ups: UpsInfo[] }>("/api/ups"),
|
||||
history: (id: number, days: number) => request<UpsHistory>(`/api/ups/${id}/history?days=${days}`),
|
||||
|
||||
Reference in new issue
Block a user