diff options
author | Chocobozzz <me@florianbigard.com> | 2023-05-03 15:17:11 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2023-05-09 08:57:34 +0200 |
commit | 6a4905602636afd6650c9e6f4d0fcc2105d91100 (patch) | |
tree | 1a6ffa4239f62bffa2e6e328ea61a52a65d58d35 /server/middlewares | |
parent | 3a0c2a77b1a6626699514ddaf8135f4397175443 (diff) | |
download | PeerTube-6a4905602636afd6650c9e6f4d0fcc2105d91100.tar.gz PeerTube-6a4905602636afd6650c9e6f4d0fcc2105d91100.tar.zst PeerTube-6a4905602636afd6650c9e6f4d0fcc2105d91100.zip |
Add TMP persistent directory
To store files that must be preserved between peertube restarts
Diffstat (limited to 'server/middlewares')
-rw-r--r-- | server/middlewares/validators/videos/video-studio.ts | 6 |
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' |
10 | import { cleanUpReqFiles } from '@server/helpers/express-utils' | 10 | import { cleanUpReqFiles } from '@server/helpers/express-utils' |
11 | import { CONFIG } from '@server/initializers/config' | 11 | import { CONFIG } from '@server/initializers/config' |
12 | import { approximateIntroOutroAdditionalSize, getTaskFile } from '@server/lib/video-studio' | 12 | import { approximateIntroOutroAdditionalSize, getTaskFileFromReq } from '@server/lib/video-studio' |
13 | import { isAudioFile } from '@shared/ffmpeg' | 13 | import { isAudioFile } from '@shared/ffmpeg' |
14 | import { HttpStatusCode, UserRight, VideoState, VideoStudioCreateEdition, VideoStudioTask } from '@shared/models' | 14 | import { HttpStatusCode, UserRight, VideoState, VideoStudioCreateEdition, VideoStudioTask } from '@shared/models' |
15 | import { areValidationErrors, checkUserCanManageVideo, checkUserQuota, doesVideoExist } from '../shared' | 15 | import { 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() |