From 6a4905602636afd6650c9e6f4d0fcc2105d91100 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 3 May 2023 15:17:11 +0200 Subject: Add TMP persistent directory To store files that must be preserved between peertube restarts --- server/middlewares/validators/videos/video-studio.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/middlewares') diff --git a/server/middlewares/validators/videos/video-studio.ts b/server/middlewares/validators/videos/video-studio.ts index 4397e887e..7a68f88e5 100644 --- a/server/middlewares/validators/videos/video-studio.ts +++ b/server/middlewares/validators/videos/video-studio.ts @@ -9,7 +9,7 @@ import { } from '@server/helpers/custom-validators/video-studio' import { cleanUpReqFiles } from '@server/helpers/express-utils' import { CONFIG } from '@server/initializers/config' -import { approximateIntroOutroAdditionalSize, getTaskFile } from '@server/lib/video-studio' +import { approximateIntroOutroAdditionalSize, getTaskFileFromReq } from '@server/lib/video-studio' import { isAudioFile } from '@shared/ffmpeg' import { HttpStatusCode, UserRight, VideoState, VideoStudioCreateEdition, VideoStudioTask } from '@shared/models' import { areValidationErrors, checkUserCanManageVideo, checkUserQuota, doesVideoExist } from '../shared' @@ -49,7 +49,7 @@ const videoStudioAddEditionValidator = [ } if (task.name === 'add-intro' || task.name === 'add-outro') { - const filePath = getTaskFile(files, i).path + const filePath = getTaskFileFromReq(files, i).path // Our concat filter needs a video stream if (await isAudioFile(filePath)) { @@ -79,7 +79,7 @@ const videoStudioAddEditionValidator = [ if (!checkUserCanManageVideo(user, video, UserRight.UPDATE_ANY_VIDEO, res)) return cleanUpReqFiles(req) // Try to make an approximation of bytes added by the intro/outro - const additionalBytes = await approximateIntroOutroAdditionalSize(video, body.tasks, i => getTaskFile(files, i).path) + const additionalBytes = await approximateIntroOutroAdditionalSize(video, body.tasks, i => getTaskFileFromReq(files, i).path) if (await checkUserQuota(user, additionalBytes, res) === false) return cleanUpReqFiles(req) return next() -- cgit v1.2.3