]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/videos.ts
add quarantine videos feature (#1637)
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / videos.ts
index ce4492a30602f36e2bf7473961118fb148b48073..dd9d62d24192e315bc9dbb3a68aa5590895e3abc 100644 (file)
@@ -88,8 +88,8 @@ function isVideoFileExtnameValid (value: string) {
 
 function isVideoFile (files: { [ fieldname: string ]: Express.Multer.File[] } | Express.Multer.File[]) {
   const videoFileTypesRegex = Object.keys(MIMETYPES.VIDEO.MIMETYPE_EXT)
-                               .map(m => `(${m})`)
-                               .join('|')
+                                    .map(m => `(${m})`)
+                                    .join('|')
 
   return isFileValid(files, videoFileTypesRegex, 'videofile', null)
 }
@@ -165,7 +165,7 @@ function checkUserCanManageVideo (user: UserModel, video: VideoModel, right: Use
   return true
 }
 
-async function isVideoExist (id: string, res: Response, fetchType: VideoFetchType = 'all') {
+async function doesVideoExist (id: number | string, res: Response, fetchType: VideoFetchType = 'all') {
   const userId = res.locals.oauth ? res.locals.oauth.token.User.id : undefined
 
   const video = await fetchVideo(id, fetchType, userId)
@@ -182,7 +182,7 @@ async function isVideoExist (id: string, res: Response, fetchType: VideoFetchTyp
   return true
 }
 
-async function isVideoChannelOfAccountExist (channelId: number, user: UserModel, res: Response) {
+async function doesVideoChannelOfAccountExist (channelId: number, user: UserModel, res: Response) {
   if (user.hasRight(UserRight.UPDATE_ANY_VIDEO) === true) {
     const videoChannel = await VideoChannelModel.loadAndPopulateAccount(channelId)
     if (videoChannel === null) {
@@ -236,9 +236,9 @@ export {
   isVideoPrivacyValid,
   isVideoFileResolutionValid,
   isVideoFileSizeValid,
-  isVideoExist,
+  doesVideoExist,
   isVideoImage,
-  isVideoChannelOfAccountExist,
+  doesVideoChannelOfAccountExist,
   isVideoSupportValid,
   isVideoFilterValid
 }