-import { Job } from 'bull'
+import { Job } from 'bullmq'
import { copyFile, ensureDir, move, remove, stat } from 'fs-extra'
import { basename, extname as extnameUtil, join } from 'path'
import { toEven } from '@server/helpers/core-utils'
// Move video file
await move(join(videoTranscodedBasePath, videoFilename), videoFilePath, { overwrite: true })
+ // Update video duration if it was not set (in case of a live for example)
+ if (!video.duration) {
+ video.duration = await getVideoStreamDuration(videoFilePath)
+ await video.save()
+ }
+
const stats = await stat(videoFilePath)
newVideoFile.size = stats.size