From: Chocobozzz Date: Thu, 8 Mar 2018 13:09:09 +0000 (+0100) Subject: Do not destroy the video if transcoding fails X-Git-Tag: v1.0.0-alpha.5~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b0ef17828c41dd40652f566033bf9824eccdb636;p=oweals%2Fpeertube.git Do not destroy the video if transcoding fails --- diff --git a/server/models/video/video.ts b/server/models/video/video.ts index f6a21814c..1b9d68073 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1138,10 +1138,10 @@ export class VideoModel extends Model { 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