From 1cd3facc3de899ac864e979cd6d6a704b712cce3 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 10 Oct 2018 11:46:50 +0200 Subject: Add ability to list all local videos Including private/unlisted for moderators/admins --- server/helpers/custom-validators/videos.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/helpers/custom-validators') diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index 714f7ac95..a13b09ac8 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts @@ -3,7 +3,7 @@ import 'express-validator' import { values } from 'lodash' import 'multer' import * as validator from 'validator' -import { UserRight, VideoPrivacy, VideoRateType } from '../../../shared' +import { UserRight, VideoFilter, VideoPrivacy, VideoRateType } from '../../../shared' import { CONSTRAINTS_FIELDS, VIDEO_CATEGORIES, @@ -22,6 +22,10 @@ import { fetchVideo, VideoFetchType } from '../video' const VIDEOS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEOS +function isVideoFilterValid (filter: VideoFilter) { + return filter === 'local' || filter === 'all-local' +} + function isVideoCategoryValid (value: any) { return value === null || VIDEO_CATEGORIES[ value ] !== undefined } @@ -225,5 +229,6 @@ export { isVideoExist, isVideoImage, isVideoChannelOfAccountExist, - isVideoSupportValid + isVideoSupportValid, + isVideoFilterValid } -- cgit v1.2.3