Do not destroy the video if transcoding fails
authorChocobozzz <me@florianbigard.com>
Thu, 8 Mar 2018 13:09:09 +0000 (14:09 +0100)
committerChocobozzz <me@florianbigard.com>
Thu, 8 Mar 2018 13:09:09 +0000 (14:09 +0100)
server/models/video/video.ts

index f6a21814cf362768911f49c16eaa5cd794abb983..1b9d68073186fac447e81137710aa45737e46a26 100644 (file)
@@ -1138,10 +1138,10 @@ export class VideoModel extends Model<VideoModel> {
       outputPath: videoOutputPath
     }
 
-    try {
-      // Could be very long!
-      await transcode(transcodeOptions)
+    // Could be very long!
+    await transcode(transcodeOptions)
 
+    try {
       await unlinkPromise(videoInputPath)
 
       // Important to do this before getVideoFilename() to take in account the new file extension