From e3a682a877a10833cb54ac3595e55110bda95647 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 14 Feb 2018 15:33:49 +0100 Subject: Handle thumbnail update --- server/controllers/api/videos/index.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'server/controllers') diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 1a4de081f..10b6c000f 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -195,7 +195,10 @@ async function addVideo (req: express.Request, res: express.Response, videoPhysi const videoFile = new VideoFileModel(videoFileData) const videoDir = CONFIG.STORAGE.VIDEOS_DIR const destination = join(videoDir, video.getVideoFilename(videoFile)) + await renamePromise(videoPhysicalFile.path, destination) + // This is important in case if there is another attempt in the retry process + videoPhysicalFile.filename = video.getVideoFilename(videoFile) // Process thumbnail or create it from the video const thumbnailField = req.files['thumbnailfile'] -- cgit v1.2.3