From 52fe4b671a20c37ae46cf88d175dd16cddfc4de7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 16 Mar 2022 18:21:36 +0100 Subject: Fix torrent creation --- server/lib/job-queue/handlers/manage-video-torrent.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'server/lib/job-queue/handlers/manage-video-torrent.ts') diff --git a/server/lib/job-queue/handlers/manage-video-torrent.ts b/server/lib/job-queue/handlers/manage-video-torrent.ts index 5cb4287e1..dfd4e6140 100644 --- a/server/lib/job-queue/handlers/manage-video-torrent.ts +++ b/server/lib/job-queue/handlers/manage-video-torrent.ts @@ -28,6 +28,8 @@ async function doCreateAction (payload: ManageVideoTorrentPayload & { action: 'c loadFileOrLog(payload.videoFileId) ]) + if (!video || !file) return + await createTorrentAndSetInfoHash(video, file) // Refresh videoFile because the createTorrentAndSetInfoHash could be long @@ -48,6 +50,8 @@ async function doUpdateMetadataAction (payload: ManageVideoTorrentPayload & { ac loadFileOrLog(payload.videoFileId) ]) + if ((!video && !streamingPlaylist) || !file) return + await updateTorrentMetadata(video || streamingPlaylist, file) await file.save() -- cgit v1.2.3