From d511df28906f84c7d25ecb24e41515ed549ff276 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Jan 2022 14:58:16 +0100 Subject: Add ability to filter my imports by target URL --- server/lib/job-queue/handlers/video-import.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'server/lib/job-queue/handlers/video-import.ts') 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' async function processVideoImport (job: Job) { const payload = job.data as VideoImportPayload - const videoImport = await getVideoImportOrDie(payload.videoImportId) + const videoImport = await getVideoImportOrDie(payload) if (videoImport.state === VideoImportState.CANCELLED) { logger.info('Do not process import since it has been cancelled', { payload }) return @@ -89,10 +89,10 @@ async function processYoutubeDLImport (job: Job, videoImport: MVideoImportDefaul ) } -async function getVideoImportOrDie (videoImportId: number) { - const videoImport = await VideoImportModel.loadAndPopulateVideo(videoImportId) +async function getVideoImportOrDie (payload: VideoImportPayload) { + const videoImport = await VideoImportModel.loadAndPopulateVideo(payload.videoImportId) if (!videoImport || !videoImport.Video) { - throw new Error('Cannot import video %s: the video import or video linked to this import does not exist anymore.') + throw new Error(`Cannot import video ${payload.videoImportId}: the video import or video linked to this import does not exist anymore.`) } return videoImport -- cgit v1.2.3