async function getVideoImportOrDie (payload: VideoImportPayload) {
const videoImport = await VideoImportModel.loadAndPopulateVideo(payload.videoImportId)
- if (!videoImport || !videoImport.Video) {
+ if (!videoImport?.Video) {
throw new Error(`Cannot import video ${payload.videoImportId}: the video import or video linked to this import does not exist anymore.`)
}
const miniatureModel = await generateVideoMiniature({
video: videoImportWithFiles.Video,
videoFile,
- type: ThumbnailType.MINIATURE
+ type: thumbnailType
})
const miniatureJSONSave = miniatureModel.toJSON()