import { createSidecarProxy } from '@@/sidecar/create-proxy'; import { mountPrefix } from '@@/plugins/manifest'; import { manifest } from '../manifest'; // /api/jellyfin/* — auth, then forward to officer-jellyfin. No routes of its own and no Jellyfin knowledge: // this file must never grow app logic. // // The sidecar owns the Jellyfin contract and holds its credentials. // // `timeoutSeconds` is generous because this proxy carries VIDEO. A direct-play stream holds one connection // open for the length of the film, and the first request against a fresh transcode waits on ffmpeg starting // up. The default 60s idle drop would cut both. const proxy = createSidecarProxy({ name: 'jellyfin', // DERIVED, never written out: `mountPrefix` returns `/jellyfin` for a first-party plugin and // `/p//jellyfin` for anyone else's, so a literal is right only by coincidence. prefix: `/api${mountPrefix({ appName: 'jellyfin', manifest })}`, timeoutSeconds: 3600, }); export const router = proxy.router; /** Base URL of the sidecar's HTTP server, or null if it hasn't reported in yet. */ export const getJellyfinServerUrl = proxy.getHttpUrl;