aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/validators/videos/video-studio.ts6
1 files changed, 3 insertions, 3 deletions
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 {
9} from '@server/helpers/custom-validators/video-studio' 9} from '@server/helpers/custom-validators/video-studio'
10import { cleanUpReqFiles } from '@server/helpers/express-utils' 10import { cleanUpReqFiles } from '@server/helpers/express-utils'
11import { CONFIG } from '@server/initializers/config' 11import { CONFIG } from '@server/initializers/config'
12import { approximateIntroOutroAdditionalSize, getTaskFile } from '@server/lib/video-studio' 12import { approximateIntroOutroAdditionalSize, getTaskFileFromReq } from '@server/lib/video-studio'
13import { isAudioFile } from '@shared/ffmpeg' 13import { isAudioFile } from '@shared/ffmpeg'
14import { HttpStatusCode, UserRight, VideoState, VideoStudioCreateEdition, VideoStudioTask } from '@shared/models' 14import { HttpStatusCode, UserRight, VideoState, VideoStudioCreateEdition, VideoStudioTask } from '@shared/models'
15import { areValidationErrors, checkUserCanManageVideo, checkUserQuota, doesVideoExist } from '../shared' 15import { areValidationErrors, checkUserCanManageVideo, checkUserQuota, doesVideoExist } from '../shared'
@@ -49,7 +49,7 @@ const videoStudioAddEditionValidator = [
49 } 49 }
50 50
51 if (task.name === 'add-intro' || task.name === 'add-outro') { 51 if (task.name === 'add-intro' || task.name === 'add-outro') {
52 const filePath = getTaskFile(files, i).path 52 const filePath = getTaskFileFromReq(files, i).path
53 53
54 // Our concat filter needs a video stream 54 // Our concat filter needs a video stream
55 if (await isAudioFile(filePath)) { 55 if (await isAudioFile(filePath)) {
@@ -79,7 +79,7 @@ const videoStudioAddEditionValidator = [
79 if (!checkUserCanManageVideo(user, video, UserRight.UPDATE_ANY_VIDEO, res)) return cleanUpReqFiles(req) 79 if (!checkUserCanManageVideo(user, video, UserRight.UPDATE_ANY_VIDEO, res)) return cleanUpReqFiles(req)
80 80
81 // Try to make an approximation of bytes added by the intro/outro 81 // Try to make an approximation of bytes added by the intro/outro
82 const additionalBytes = await approximateIntroOutroAdditionalSize(video, body.tasks, i => getTaskFile(files, i).path) 82 const additionalBytes = await approximateIntroOutroAdditionalSize(video, body.tasks, i => getTaskFileFromReq(files, i).path)
83 if (await checkUserQuota(user, additionalBytes, res) === false) return cleanUpReqFiles(req) 83 if (await checkUserQuota(user, additionalBytes, res) === false) return cleanUpReqFiles(req)
84 84
85 return next() 85 return next()