From 93fe368487717c89aff830209c2f68a5033f001b Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Wed, 25 Sep 2024 15:47:33 +0800 Subject: [PATCH] remove unnecessary code --- src/main/ffmpeg.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/ffmpeg.ts b/src/main/ffmpeg.ts index 1fb536e2..a6656693 100644 --- a/src/main/ffmpeg.ts +++ b/src/main/ffmpeg.ts @@ -104,11 +104,10 @@ function handleProgress( if (durationIn == null) return; const duration = Math.max(0, durationIn); if (duration === 0) return; - const progress = duration ? Math.min(progressTime / duration, 1) : 0; // sometimes progressTime will be greater than cutDuration + const progress = Math.min(progressTime / duration, 1); // sometimes progressTime will be greater than cutDuration onProgress(progress); } catch (err) { - // @ts-expect-error todo - logger.error('Failed to parse ffmpeg progress line:', err.message); + logger.error('Failed to parse ffmpeg progress line:', err instanceof Error ? err.message : err); } }); }