aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/job-queue/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r--server/lib/job-queue/handlers/video-import.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts
index cb79725aa..1630ecabd 100644
--- a/server/lib/job-queue/handlers/video-import.ts
+++ b/server/lib/job-queue/handlers/video-import.ts
@@ -42,7 +42,7 @@ import { generateVideoMiniature } from '../../thumbnail'
42async function processVideoImport (job: Job) { 42async function processVideoImport (job: Job) {
43 const payload = job.data as VideoImportPayload 43 const payload = job.data as VideoImportPayload
44 44
45 const videoImport = await getVideoImportOrDie(payload.videoImportId) 45 const videoImport = await getVideoImportOrDie(payload)
46 if (videoImport.state === VideoImportState.CANCELLED) { 46 if (videoImport.state === VideoImportState.CANCELLED) {
47 logger.info('Do not process import since it has been cancelled', { payload }) 47 logger.info('Do not process import since it has been cancelled', { payload })
48 return 48 return
@@ -89,10 +89,10 @@ async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefaul
89 ) 89 )
90} 90}
91 91
92async function getVideoImportOrDie (videoImportId: number) { 92async function getVideoImportOrDie (payload: VideoImportPayload) {
93 const videoImport = await VideoImportModel.loadAndPopulateVideo(videoImportId) 93 const videoImport = await VideoImportModel.loadAndPopulateVideo(payload.videoImportId)
94 if (!videoImport || !videoImport.Video) { 94 if (!videoImport || !videoImport.Video) {
95 throw new Error('Cannot import video %s: the video import or video linked to this import does not exist anymore.') 95 throw new Error(`Cannot import video ${payload.videoImportId}: the video import or video linked to this import does not exist anymore.`)
96 } 96 }
97 97
98 return videoImport 98 return videoImport