]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/validators/videos/videos.ts
Add ability to search playlists
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / videos / videos.ts
index a707fd08690ebebc26f78543ff2c84a45e24ece0..2bed5f18123b09ff9e5ce1a4538d1ab2b7902ee5 100644 (file)
@@ -4,7 +4,7 @@ import { getResumableUploadPath } from '@server/helpers/upload'
 import { isAbleToUploadVideo } from '@server/lib/user'
 import { getServerActor } from '@server/models/application/application'
 import { ExpressPromiseHandler } from '@server/types/express'
-import { MUserAccountId, MVideoWithRights } from '@server/types/models'
+import { MUserAccountId, MVideoFullLight } from '@server/types/models'
 import { ServerErrorCode, UserRight, VideoChangeOwnershipStatus, VideoPrivacy } from '../../../../shared'
 import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
 import { VideoChangeOwnershipAccept } from '../../../../shared/models/videos/change-ownership/video-change-ownership-accept.model'
@@ -258,7 +258,7 @@ async function checkVideoFollowConstraints (req: express.Request, res: express.R
 }
 
 const videosCustomGetValidator = (
-  fetchType: 'for-api' | 'all' | 'only-video' | 'only-video-with-rights' | 'only-immutable-attributes',
+  fetchType: 'for-api' | 'all' | 'only-video' | 'only-immutable-attributes',
   authenticateInQuery = false
 ) => {
   return [
@@ -273,7 +273,7 @@ const videosCustomGetValidator = (
       // Controllers does not need to check video rights
       if (fetchType === 'only-immutable-attributes') return next()
 
-      const video = getVideoWithAttributes(res) as MVideoWithRights
+      const video = getVideoWithAttributes(res) as MVideoFullLight
 
       // Video private or blacklisted
       if (video.requiresAuth()) {