Skip to content

Commit 0677b9a

Browse files
committed
Correct the ffmpeg progress condition so it will be truthy sometimes.
1 parent 94f85a3 commit 0677b9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

functions/src/events/scrapeEvents.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ const extractAudioFromVideo = async (
154154
console.log(`Spawned FFmpeg with command: ${commandLine}`)
155155
})
156156
.on("progress", progress => {
157-
if (progress && progress.percent && progress.percent % 10 === 0) {
157+
if (
158+
progress &&
159+
progress.percent &&
160+
Math.round(progress.percent) % 10 === 0
161+
) {
158162
console.log(`Processing: ${progress.percent}% done`)
159163
}
160164
})

0 commit comments

Comments
 (0)