diff --git a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts index a6843eb0ff79..2e312c2961da 100644 --- a/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts +++ b/client/src/app/+videos/+video-edit/video-add-components/video-upload.component.ts @@ -205,7 +205,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy this.resumableUploadService.handleFiles(this.previewfileUpload, { ...this.options, metadata: { - isAudio: true + isPreviewForAudio: true } }) } else { diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index df744597efcc..26b33d158fc1 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -149,7 +149,7 @@ const videosAddResumableValidator = getCommonVideoEditAttributes().concat([ file.path = `${CONFIG.STORAGE.VIDEOS_DIR}${file.id}` if ( - !file.metadata.isAudio && + !file.metadata.isPreviewForAudio && !await doesVideoChannelOfAccountExist(file.metadata.channelId, user, res) ) return @@ -158,7 +158,7 @@ const videosAddResumableValidator = getCommonVideoEditAttributes().concat([ return res.status(HttpStatusCode.BAD_REQUEST_400).json({ error: 'Video was refused.' }) } - if (file.metadata.isAudio) { + if (file.metadata.isPreviewForAudio) { const filename = `${file.id}-${uuidv4()}` file.filename = filename try { @@ -180,7 +180,7 @@ const videosAddResumableValidator = getCommonVideoEditAttributes().concat([ res.locals.videoFileResumable = file as any - if (req.method !== 'POST' || req.body.isAudio) { + if (req.method !== 'POST' || req.body.isPreviewForAudio) { return next() } /** The middleware applies what follows only to non-audio POST */