mirror of
https://github.com/immich-app/immich.git
synced 2026-08-01 00:21:10 -07:00
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:
@@ -30,6 +30,7 @@ type Session = {
|
||||
ownerId: string;
|
||||
paused: boolean;
|
||||
process: ChildProcess | null;
|
||||
starting: boolean;
|
||||
startSegment: number | null;
|
||||
variantIndex: number | null;
|
||||
};
|
||||
@@ -75,6 +76,7 @@ export class TranscodingService extends BaseService {
|
||||
ownerId,
|
||||
paused: false,
|
||||
process: null,
|
||||
starting: false,
|
||||
startSegment: null,
|
||||
variantIndex: null,
|
||||
});
|
||||
@@ -145,11 +147,19 @@ export class TranscodingService extends BaseService {
|
||||
} else if (session.process) {
|
||||
this.resumeTranscode(session);
|
||||
return;
|
||||
} else if (session.starting) {
|
||||
this.logger.debug(`Session ${sessionId} is already starting a transcode, skipping duplicate start request`);
|
||||
return;
|
||||
}
|
||||
|
||||
const process = await this.startTranscode(session, variantIndex, segmentIndex);
|
||||
if (process) {
|
||||
session.process = process;
|
||||
session.starting = true;
|
||||
try {
|
||||
const process = await this.startTranscode(session, variantIndex, segmentIndex);
|
||||
if (process) {
|
||||
session.process = process;
|
||||
}
|
||||
} finally {
|
||||
session.starting = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user