fix(server): add hint header for segment after init.mp4 (#28867)

* add hint header for segment after init.mp4

* use zod

* actually validate

* update openapi

* linting
This commit is contained in:
Mert
2026-06-10 19:18:36 -04:00
committed by GitHub
parent 74878628c8
commit aa126e377c
9 changed files with 115 additions and 17 deletions
+6 -2
View File
@@ -4472,13 +4472,14 @@ export function getMediaPlaylist({ id, key, sessionId, slug, variantIndex }: {
/**
* Get HLS segment or init file
*/
export function getSegment({ filename, id, key, sessionId, slug, variantIndex }: {
export function getSegment({ filename, id, key, sessionId, slug, variantIndex, xImmichHlsMsn }: {
filename: string;
id: string;
key?: string;
sessionId: string;
slug?: string;
variantIndex: number;
xImmichHlsMsn?: number;
}, opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchBlob<{
status: 200;
@@ -4487,7 +4488,10 @@ export function getSegment({ filename, id, key, sessionId, slug, variantIndex }:
key,
slug
}))}`, {
...opts
...opts,
headers: oazapfts.mergeHeaders(opts?.headers, {
"x-immich-hls-msn": xImmichHlsMsn
})
}));
}
/**