import * as express from 'express'
-import { query } from 'express-validator/check'
+import { query } from 'express-validator'
import { join } from 'path'
-import { isTestInstance, logger } from '../../helpers'
+import { isTestInstance } from '../../helpers/core-utils'
import { isIdOrUUIDValid } from '../../helpers/custom-validators/misc'
-import { isVideoExist } from '../../helpers/custom-validators/videos'
-import { CONFIG } from '../../initializers'
+import { logger } from '../../helpers/logger'
import { areValidationErrors } from './utils'
+import { WEBSERVER } from '../../initializers/constants'
+import { doesVideoExist } from '../../helpers/middlewares'
-const urlShouldStartWith = CONFIG.WEBSERVER.SCHEME + '://' + join(CONFIG.WEBSERVER.HOST, 'videos', 'watch') + '/'
+const urlShouldStartWith = WEBSERVER.SCHEME + '://' + join(WEBSERVER.HOST, 'videos', 'watch') + '/'
const videoWatchRegex = new RegExp('([^/]+)$')
const isURLOptions = {
require_host: true,
.end()
}
- if (!await isVideoExist(videoId, res)) return
+ if (!await doesVideoExist(videoId, res)) return
return next()
}