Skip to content

Commit

Permalink
rename ex-isAudioBg to more explicit name mentioning it is a preview …
Browse files Browse the repository at this point in the history
…file for audio
  • Loading branch information
rigelk committed Apr 19, 2021
1 parent db16ad7 commit 41b789a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 3 additions & 3 deletions server/middlewares/validators/videos/videos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 {
Expand All @@ -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 */

Expand Down

0 comments on commit 41b789a

Please sign in to comment.