diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-09 11:06:13 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-09 11:17:36 +0200 |
commit | 14d3270f363245d2c83fcc2ac109e39743b5627e (patch) | |
tree | 22a1d40675d372d53c35a4d7adf1fc1b4ceb1799 /server/helpers/custom-validators | |
parent | aa8b6df4a51c82eb91e6fd71a090b2128098af6b (diff) | |
download | PeerTube-14d3270f363245d2c83fcc2ac109e39743b5627e.tar.gz PeerTube-14d3270f363245d2c83fcc2ac109e39743b5627e.tar.zst PeerTube-14d3270f363245d2c83fcc2ac109e39743b5627e.zip |
Change how we handle resolution
It was an enum before, now we just use video height
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r-- | server/helpers/custom-validators/videos.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/server/helpers/custom-validators/videos.ts b/server/helpers/custom-validators/videos.ts index 2eb021ae7..a31aca019 100644 --- a/server/helpers/custom-validators/videos.ts +++ b/server/helpers/custom-validators/videos.ts | |||
@@ -8,8 +8,7 @@ import { | |||
8 | VIDEO_CATEGORIES, | 8 | VIDEO_CATEGORIES, |
9 | VIDEO_LICENCES, | 9 | VIDEO_LICENCES, |
10 | VIDEO_LANGUAGES, | 10 | VIDEO_LANGUAGES, |
11 | VIDEO_RATE_TYPES, | 11 | VIDEO_RATE_TYPES |
12 | VIDEO_FILE_RESOLUTIONS | ||
13 | } from '../../initializers' | 12 | } from '../../initializers' |
14 | import { isUserUsernameValid } from './users' | 13 | import { isUserUsernameValid } from './users' |
15 | import { isArray, exists } from './misc' | 14 | import { isArray, exists } from './misc' |
@@ -128,7 +127,7 @@ function isVideoFileSizeValid (value: string) { | |||
128 | } | 127 | } |
129 | 128 | ||
130 | function isVideoFileResolutionValid (value: string) { | 129 | function isVideoFileResolutionValid (value: string) { |
131 | return VIDEO_FILE_RESOLUTIONS[value] !== undefined | 130 | return exists(value) && validator.isInt(value + '') |
132 | } | 131 | } |
133 | 132 | ||
134 | function isVideoFileExtnameValid (value: string) { | 133 | function isVideoFileExtnameValid (value: string) { |