]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/video-captions.ts
Add ability to list comments on local videos
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / video-captions.ts
index 441c6b4be2554c8117eca74a7814efb81105a603..dfb8fefc5c83a122832d09ec62f5ab4144a197c8 100644 (file)
@@ -7,7 +7,7 @@ import { logger } from '../../../helpers/logger'
 import { CONSTRAINTS_FIELDS, MIMETYPES } from '../../../initializers/constants'
 import {
   areValidationErrors,
-  checkCanSeeVideoIfPrivate,
+  checkCanSeeVideo,
   checkUserCanManageVideo,
   doesVideoCaptionExist,
   doesVideoExist,
@@ -74,7 +74,7 @@ const listVideoCaptionsValidator = [
     if (!await doesVideoExist(req.params.videoId, res, 'only-video')) return
 
     const video = res.locals.onlyVideo
-    if (!await checkCanSeeVideoIfPrivate(req, res, video)) return
+    if (!await checkCanSeeVideo({ req, res, video, paramId: req.params.videoId })) return
 
     return next()
   }