From 74dc3bca2b14f5fd3fe80c394dfc34177a46db77 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 11 Apr 2019 14:26:41 +0200 Subject: Don't expose constants directly in initializers/ --- server/middlewares/validators/videos/video-captions.ts | 2 +- server/middlewares/validators/videos/video-channels.ts | 3 +-- server/middlewares/validators/videos/video-imports.ts | 2 +- server/middlewares/validators/videos/video-playlists.ts | 2 +- server/middlewares/validators/videos/videos.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) (limited to 'server/middlewares/validators/videos') diff --git a/server/middlewares/validators/videos/video-captions.ts b/server/middlewares/validators/videos/video-captions.ts index b2b259aff..d857ac3ec 100644 --- a/server/middlewares/validators/videos/video-captions.ts +++ b/server/middlewares/validators/videos/video-captions.ts @@ -3,7 +3,7 @@ import { areValidationErrors } from '../utils' import { checkUserCanManageVideo, doesVideoExist } from '../../../helpers/custom-validators/videos' import { isIdOrUUIDValid } from '../../../helpers/custom-validators/misc' import { body, param } from 'express-validator/check' -import { CONSTRAINTS_FIELDS } from '../../../initializers' +import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' import { UserRight } from '../../../../shared' import { logger } from '../../../helpers/logger' import { doesVideoCaptionExist, isVideoCaptionFile, isVideoCaptionLanguageValid } from '../../../helpers/custom-validators/video-captions' diff --git a/server/middlewares/validators/videos/video-channels.ts b/server/middlewares/validators/videos/video-channels.ts index e2067c4d9..4b26f0bc4 100644 --- a/server/middlewares/validators/videos/video-channels.ts +++ b/server/middlewares/validators/videos/video-channels.ts @@ -1,12 +1,11 @@ import * as express from 'express' import { body, param } from 'express-validator/check' import { UserRight } from '../../../../shared' -import { doesAccountNameWithHostExist } from '../../../helpers/custom-validators/accounts' import { doesLocalVideoChannelNameExist, + doesVideoChannelNameWithHostExist, isVideoChannelDescriptionValid, isVideoChannelNameValid, - doesVideoChannelNameWithHostExist, isVideoChannelSupportValid } from '../../../helpers/custom-validators/video-channels' import { logger } from '../../../helpers/logger' diff --git a/server/middlewares/validators/videos/video-imports.ts b/server/middlewares/validators/videos/video-imports.ts index fb13f3ceb..452084a7c 100644 --- a/server/middlewares/validators/videos/video-imports.ts +++ b/server/middlewares/validators/videos/video-imports.ts @@ -8,7 +8,7 @@ import { isVideoImportTargetUrlValid, isVideoImportTorrentFile } from '../../../ import { cleanUpReqFiles } from '../../../helpers/express-utils' import { doesVideoChannelOfAccountExist, isVideoMagnetUriValid, isVideoNameValid } from '../../../helpers/custom-validators/videos' import { CONFIG } from '../../../initializers/config' -import { CONSTRAINTS_FIELDS } from '../../../initializers' +import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' const videoImportAddValidator = getCommonVideoEditAttributes().concat([ body('channelId') diff --git a/server/middlewares/validators/videos/video-playlists.ts b/server/middlewares/validators/videos/video-playlists.ts index 6ba30fac9..2c3f7e542 100644 --- a/server/middlewares/validators/videos/video-playlists.ts +++ b/server/middlewares/validators/videos/video-playlists.ts @@ -5,7 +5,7 @@ import { logger } from '../../../helpers/logger' import { UserModel } from '../../../models/account/user' import { areValidationErrors } from '../utils' import { doesVideoExist, isVideoImage } from '../../../helpers/custom-validators/videos' -import { CONSTRAINTS_FIELDS } from '../../../initializers' +import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' import { isArrayOf, isIdOrUUIDValid, isIdValid, isUUIDValid, toIntArray, toValueOrNull } from '../../../helpers/custom-validators/misc' import { doesVideoPlaylistExist, diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts index 7ce1a922f..e9b036a02 100644 --- a/server/middlewares/validators/videos/videos.ts +++ b/server/middlewares/validators/videos/videos.ts @@ -32,7 +32,7 @@ import { } from '../../../helpers/custom-validators/videos' import { getDurationFromVideoFile } from '../../../helpers/ffmpeg-utils' import { logger } from '../../../helpers/logger' -import { CONSTRAINTS_FIELDS } from '../../../initializers' +import { CONSTRAINTS_FIELDS } from '../../../initializers/constants' import { authenticatePromiseIfNeeded } from '../../oauth' import { areValidationErrors } from '../utils' import { cleanUpReqFiles } from '../../../helpers/express-utils' -- cgit v1.2.3