diff options
author | Chocobozzz <me@florianbigard.com> | 2022-03-16 18:21:36 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-03-16 18:35:05 +0100 |
commit | 52fe4b671a20c37ae46cf88d175dd16cddfc4de7 (patch) | |
tree | 41339d83393d9e7d3ca05b66aeb9bd79c6019b2c /server/lib/job-queue/handlers | |
parent | f012319a644fe8d9d33f2f567fa828442a3b39fd (diff) | |
download | PeerTube-52fe4b671a20c37ae46cf88d175dd16cddfc4de7.tar.gz PeerTube-52fe4b671a20c37ae46cf88d175dd16cddfc4de7.tar.zst PeerTube-52fe4b671a20c37ae46cf88d175dd16cddfc4de7.zip |
Fix torrent creation
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r-- | server/lib/job-queue/handlers/manage-video-torrent.ts | 4 |
1 files changed, 4 insertions, 0 deletions
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 | |||
28 | loadFileOrLog(payload.videoFileId) | 28 | loadFileOrLog(payload.videoFileId) |
29 | ]) | 29 | ]) |
30 | 30 | ||
31 | if (!video || !file) return | ||
32 | |||
31 | await createTorrentAndSetInfoHash(video, file) | 33 | await createTorrentAndSetInfoHash(video, file) |
32 | 34 | ||
33 | // Refresh videoFile because the createTorrentAndSetInfoHash could be long | 35 | // Refresh videoFile because the createTorrentAndSetInfoHash could be long |
@@ -48,6 +50,8 @@ async function doUpdateMetadataAction (payload: ManageVideoTorrentPayload & { ac | |||
48 | loadFileOrLog(payload.videoFileId) | 50 | loadFileOrLog(payload.videoFileId) |
49 | ]) | 51 | ]) |
50 | 52 | ||
53 | if ((!video && !streamingPlaylist) || !file) return | ||
54 | |||
51 | await updateTorrentMetadata(video || streamingPlaylist, file) | 55 | await updateTorrentMetadata(video || streamingPlaylist, file) |
52 | 56 | ||
53 | await file.save() | 57 | await file.save() |