diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-13 18:17:05 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-14 16:03:09 +0100 |
commit | ac81d1a06d57b9ae86663831e7f5edcef57b0fa4 (patch) | |
tree | da31775c9533d3e270f68f921e146f086bf7c0b8 /server/initializers/constants.ts | |
parent | e883399fa6caa56bb8519c9a2e22d88001f26661 (diff) | |
download | PeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.tar.gz PeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.tar.zst PeerTube-ac81d1a06d57b9ae86663831e7f5edcef57b0fa4.zip |
Add ability to set video thumbnail/preview
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r-- | server/initializers/constants.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index e531c4c39..91fbbde75 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -182,6 +182,12 @@ const CONSTRAINTS_FIELDS = { | |||
182 | NAME: { min: 3, max: 120 }, // Length | 182 | NAME: { min: 3, max: 120 }, // Length |
183 | TRUNCATED_DESCRIPTION: { min: 3, max: 250 }, // Length | 183 | TRUNCATED_DESCRIPTION: { min: 3, max: 250 }, // Length |
184 | DESCRIPTION: { min: 3, max: 3000 }, // Length | 184 | DESCRIPTION: { min: 3, max: 3000 }, // Length |
185 | IMAGE: { | ||
186 | EXTNAME: [ '.jpg', '.jpeg' ], | ||
187 | FILE_SIZE: { | ||
188 | max: 2 * 1024 * 1024 // 2MB | ||
189 | } | ||
190 | }, | ||
185 | EXTNAME: [ '.mp4', '.ogv', '.webm' ], | 191 | EXTNAME: [ '.mp4', '.ogv', '.webm' ], |
186 | INFO_HASH: { min: 40, max: 40 }, // Length, info hash is 20 bytes length but we represent it in hexadecimal so 20 * 2 | 192 | INFO_HASH: { min: 40, max: 40 }, // Length, info hash is 20 bytes length but we represent it in hexadecimal so 20 * 2 |
187 | DURATION: { min: 1 }, // Number | 193 | DURATION: { min: 1 }, // Number |
@@ -285,7 +291,7 @@ const VIDEO_MIMETYPE_EXT = { | |||
285 | 'video/mp4': '.mp4' | 291 | 'video/mp4': '.mp4' |
286 | } | 292 | } |
287 | 293 | ||
288 | const AVATAR_MIMETYPE_EXT = { | 294 | const IMAGE_MIMETYPE_EXT = { |
289 | 'image/png': '.png', | 295 | 'image/png': '.png', |
290 | 'image/jpg': '.jpg', | 296 | 'image/jpg': '.jpg', |
291 | 'image/jpeg': '.jpg' | 297 | 'image/jpeg': '.jpg' |
@@ -427,7 +433,7 @@ export { | |||
427 | VIDEO_RATE_TYPES, | 433 | VIDEO_RATE_TYPES, |
428 | VIDEO_MIMETYPE_EXT, | 434 | VIDEO_MIMETYPE_EXT, |
429 | USER_PASSWORD_RESET_LIFETIME, | 435 | USER_PASSWORD_RESET_LIFETIME, |
430 | AVATAR_MIMETYPE_EXT, | 436 | IMAGE_MIMETYPE_EXT, |
431 | SCHEDULER_INTERVAL, | 437 | SCHEDULER_INTERVAL, |
432 | JOB_COMPLETED_LIFETIME | 438 | JOB_COMPLETED_LIFETIME |
433 | } | 439 | } |