From a76c39812f2c78e485722a0d3ef2341acbdb20de Mon Sep 17 00:00:00 2001 From: Mert <101130780+mertalev@users.noreply.github.com> Date: Wed, 23 Oct 2024 08:49:20 -0400 Subject: [PATCH] fix(server): nan transcoding estimate (#13693) fix nan transcoding estimate --- server/src/repositories/media.repository.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/repositories/media.repository.ts b/server/src/repositories/media.repository.ts index 64cfc540e5..7e1ca84993 100644 --- a/server/src/repositories/media.repository.ts +++ b/server/src/repositories/media.repository.ts @@ -200,7 +200,7 @@ export class MediaRepository implements IMediaRepository { lastProgressFrame = progress.frames; const percent = ((progress.frames / frameCount) * 100).toFixed(2); - const ms = Math.floor((frameCount - progress.frames) / progress.currentFps) * 1000; + const ms = progress.currentFps ? Math.floor((frameCount - progress.frames) / progress.currentFps) * 1000 : 0; const duration = ms ? Duration.fromMillis(ms).rescale().toHuman({ unitDisplay: 'narrow' }) : ''; const outputText = output instanceof Writable ? 'stream' : output.split('/').pop(); this.logger.debug(