Jellyfin refs on the wire + guest relay (proto 7)

- Media can be a Jellyfin ref {serverId, itemId, mediaSourceId, title,
  subtitle, runtimeSecs}; the server never stores or broadcasts a URL
  or token for it.
- Optional server-side Jellyfin credential (serve map / --jellyfin
  file) enables GET /j/<sid>/<token>/<itemId>: range-faithful proxy of
  the active item only, exact client header fields, upstream aborted on
  disconnect, bytes counted. welcome.relayUrl / state.relay advertise it.
- Members report jf access (own account vs relay).
- /m now sends the real Content-Type (Relic overrode it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
foxyzandClaude Opus 5.5 committed 2026-10-07 01:57:04 +03:00
1 parent fb2927c094
commit 45f4c1bc84
18 files changed
+1363 -66

No files matched your search

+14 -2
View File
@@ -136,7 +136,9 @@ void mountMediaRoute(RelicApp app, File file,
log(byteCount);
return Response(
res.status,
body: Body.fromDataStream(stream, contentLength: byteCount),
// Relic replaces Content-Type with the body's mime type, so set it here.
body: Body.fromDataStream(stream,
mimeType: _mimeOf(res.headers['content-type']), contentLength: byteCount),
headers: Headers.build((h) {
res.headers.forEach((k, v) => h[k] = [v]);
}),
@@ -208,10 +210,20 @@ void mountSessionMediaRoute(
});
return Response(
res.status,
body: Body.fromDataStream(stream, contentLength: byteCount),
// Relic replaces Content-Type with the body's mime type, so set it here.
body: Body.fromDataStream(stream,
mimeType: _mimeOf(res.headers['content-type']), contentLength: byteCount),
headers: Headers.build((h) {
res.headers.forEach((k, v) => h[k] = [v]);
}),
);
});
}
MimeType _mimeOf(String? contentType) {
try {
return MimeType.parse(contentType ?? '');
} catch (_) {
return MimeType.octetStream;
}
}