mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-04 21:18:31 +01:00
- jellyfinProbe (/System/Info/Public, ProductName check) + reachabilityProbe (services with no health route). - ServerUrlStatusText: compact resolver status for ListItem-row layouts. - Streamystats + Marlin: resolve the URL on blur (https-first, http fallback) and store the canonical URL; inline status feedback.
25 lines
766 B
TypeScript
25 lines
766 B
TypeScript
import axios from "axios";
|
|
import type { ServerProbe } from "../types";
|
|
|
|
/** Public, unauthenticated Jellyfin endpoint; `ProductName` confirms the service. */
|
|
const PRODUCT_NAME = "Jellyfin Server";
|
|
|
|
export const jellyfinProbe: ServerProbe = async (url, signal) => {
|
|
try {
|
|
const { status, data } = await axios.get(`${url}/System/Info/Public`, {
|
|
signal,
|
|
timeout: 8000, // backstop; the resolver aborts via signal first
|
|
});
|
|
|
|
if (status < 200 || status >= 300) return { status: "unreachable" };
|
|
if (data?.ProductName !== PRODUCT_NAME) return { status: "wrong-service" };
|
|
|
|
return {
|
|
status: "ok",
|
|
meta: { version: data?.Version, serverName: data?.ServerName },
|
|
};
|
|
} catch {
|
|
return { status: "unreachable" };
|
|
}
|
|
};
|