import * as validator from 'validator'
import { UserRight, VideoFilter, VideoPrivacy, VideoRateType } from '../../../shared'
import {
- CONSTRAINTS_FIELDS, MIMETYPES,
+ CONSTRAINTS_FIELDS,
+ MIMETYPES,
VIDEO_CATEGORIES,
VIDEO_LICENCES,
VIDEO_PRIVACIES,
VIDEO_RATE_TYPES,
VIDEO_STATES
-} from '../../initializers'
+} from '../../initializers/constants'
import { VideoModel } from '../../models/video/video'
import { exists, isArray, isDateValid, isFileValid } from './misc'
import { VideoChannelModel } from '../../models/video/video-channel'
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)
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) {
isVideoPrivacyValid,
isVideoFileResolutionValid,
isVideoFileSizeValid,
- isVideoExist,
+ doesVideoExist,
isVideoImage,
- isVideoChannelOfAccountExist,
+ doesVideoChannelOfAccountExist,
isVideoSupportValid,
isVideoFilterValid
}