]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/job-queue/handlers/video-import.ts
Fix unregister default value
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / video-import.ts
index 99016f5114f83e99328847cbeb08f81dd6eec00d..4d361c7b915762101ea2c7c3a776670733a4b5ff 100644 (file)
@@ -107,7 +107,7 @@ async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefaul
 
 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.`)
   }
 
@@ -277,7 +277,7 @@ async function generateMiniature (videoImportWithFiles: MVideoImportDefaultFiles
   const miniatureModel = await generateVideoMiniature({
     video: videoImportWithFiles.Video,
     videoFile,
-    type: ThumbnailType.MINIATURE
+    type: thumbnailType
   })
   const miniatureJSONSave = miniatureModel.toJSON()