diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-19 09:26:50 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-03-19 09:26:50 +0100 |
commit | 0f6acda11681de90d38dd18669863c6e270851ee (patch) | |
tree | b3b28e00d539645f5a810202dc8afada289e7b2e /server/middlewares/validators/redundancy.ts | |
parent | 9a18a6252071cf21b18f82a24bb63078abb75bc1 (diff) | |
download | PeerTube-0f6acda11681de90d38dd18669863c6e270851ee.tar.gz PeerTube-0f6acda11681de90d38dd18669863c6e270851ee.tar.zst PeerTube-0f6acda11681de90d38dd18669863c6e270851ee.zip |
Does exist
Diffstat (limited to 'server/middlewares/validators/redundancy.ts')
-rw-r--r-- | server/middlewares/validators/redundancy.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/validators/redundancy.ts b/server/middlewares/validators/redundancy.ts index 329322509..419921928 100644 --- a/server/middlewares/validators/redundancy.ts +++ b/server/middlewares/validators/redundancy.ts | |||
@@ -2,7 +2,7 @@ import * as express from 'express' | |||
2 | import 'express-validator' | 2 | import 'express-validator' |
3 | import { param, body } from 'express-validator/check' | 3 | import { param, body } from 'express-validator/check' |
4 | import { exists, isBooleanValid, isIdOrUUIDValid, toIntOrNull } from '../../helpers/custom-validators/misc' | 4 | import { exists, isBooleanValid, isIdOrUUIDValid, toIntOrNull } from '../../helpers/custom-validators/misc' |
5 | import { isVideoExist } from '../../helpers/custom-validators/videos' | 5 | import { doesVideoExist } from '../../helpers/custom-validators/videos' |
6 | import { logger } from '../../helpers/logger' | 6 | import { logger } from '../../helpers/logger' |
7 | import { areValidationErrors } from './utils' | 7 | import { areValidationErrors } from './utils' |
8 | import { VideoModel } from '../../models/video/video' | 8 | import { VideoModel } from '../../models/video/video' |
@@ -27,7 +27,7 @@ const videoFileRedundancyGetValidator = [ | |||
27 | logger.debug('Checking videoFileRedundancyGetValidator parameters', { parameters: req.params }) | 27 | logger.debug('Checking videoFileRedundancyGetValidator parameters', { parameters: req.params }) |
28 | 28 | ||
29 | if (areValidationErrors(req, res)) return | 29 | if (areValidationErrors(req, res)) return |
30 | if (!await isVideoExist(req.params.videoId, res)) return | 30 | if (!await doesVideoExist(req.params.videoId, res)) return |
31 | 31 | ||
32 | const video: VideoModel = res.locals.video | 32 | const video: VideoModel = res.locals.video |
33 | const videoFile = video.VideoFiles.find(f => { | 33 | const videoFile = video.VideoFiles.find(f => { |
@@ -53,7 +53,7 @@ const videoPlaylistRedundancyGetValidator = [ | |||
53 | logger.debug('Checking videoPlaylistRedundancyGetValidator parameters', { parameters: req.params }) | 53 | logger.debug('Checking videoPlaylistRedundancyGetValidator parameters', { parameters: req.params }) |
54 | 54 | ||
55 | if (areValidationErrors(req, res)) return | 55 | if (areValidationErrors(req, res)) return |
56 | if (!await isVideoExist(req.params.videoId, res)) return | 56 | if (!await doesVideoExist(req.params.videoId, res)) return |
57 | 57 | ||
58 | const video: VideoModel = res.locals.video | 58 | const video: VideoModel = res.locals.video |
59 | const videoStreamingPlaylist = video.VideoStreamingPlaylists.find(p => p === req.params.streamingPlaylistType) | 59 | const videoStreamingPlaylist = video.VideoStreamingPlaylists.find(p => p === req.params.streamingPlaylistType) |