]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/lib/job-queue/handlers/manage-video-torrent.ts
Suffix external auth username on conflict
[github/Chocobozzz/PeerTube.git] / server / lib / job-queue / handlers / manage-video-torrent.ts
index 5cb4287e14918c19331275b3ff20be89bbeee03d..dfd4e6140bfe4894e8aa16a945375f352e433304 100644 (file)
@@ -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()