aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-02-26 10:55:40 +0100
committerChocobozzz <chocobozzz@cpy.re>2019-03-18 11:17:59 +0100
commit418d092afa81e2c8fe8ac6838fc4b5eb0af6a782 (patch)
tree5e9bc5604fd5d66a006cfebb7acdbdd5486e5d1e /server/initializers/constants.ts
parentb427febb4d5cebf03b815bca2c59af6e82491569 (diff)
downloadPeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.gz
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.tar.zst
PeerTube-418d092afa81e2c8fe8ac6838fc4b5eb0af6a782.zip
Playlist server API
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts23
1 files changed, 22 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 0d9a6a512..154a9cffe 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -10,6 +10,7 @@ import { NSFWPolicyType } from '../../shared/models/videos/nsfw-policy.type'
10import { invert } from 'lodash' 10import { invert } from 'lodash'
11import { CronRepeatOptions, EveryRepeatOptions } from 'bull' 11import { CronRepeatOptions, EveryRepeatOptions } from 'bull'
12import * as bytes from 'bytes' 12import * as bytes from 'bytes'
13import { VideoPlaylistPrivacy } from '../../shared/models/videos/playlist/video-playlist-privacy.model'
13 14
14// Use a variable to reload the configuration if we need 15// Use a variable to reload the configuration if we need
15let config: IConfig = require('config') 16let config: IConfig = require('config')
@@ -52,7 +53,9 @@ const SORTABLE_COLUMNS = {
52 ACCOUNTS_BLOCKLIST: [ 'createdAt' ], 53 ACCOUNTS_BLOCKLIST: [ 'createdAt' ],
53 SERVERS_BLOCKLIST: [ 'createdAt' ], 54 SERVERS_BLOCKLIST: [ 'createdAt' ],
54 55
55 USER_NOTIFICATIONS: [ 'createdAt' ] 56 USER_NOTIFICATIONS: [ 'createdAt' ],
57
58 VIDEO_PLAYLISTS: [ 'createdAt' ]
56} 59}
57 60
58const OAUTH_LIFETIME = { 61const OAUTH_LIFETIME = {
@@ -386,6 +389,17 @@ let CONSTRAINTS_FIELDS = {
386 FILE_SIZE: { min: 10 }, 389 FILE_SIZE: { min: 10 },
387 URL: { min: 3, max: 2000 } // Length 390 URL: { min: 3, max: 2000 } // Length
388 }, 391 },
392 VIDEO_PLAYLISTS: {
393 NAME: { min: 1, max: 120 }, // Length
394 DESCRIPTION: { min: 3, max: 1000 }, // Length
395 URL: { min: 3, max: 2000 }, // Length
396 IMAGE: {
397 EXTNAME: [ '.jpg', '.jpeg' ],
398 FILE_SIZE: {
399 max: 2 * 1024 * 1024 // 2MB
400 }
401 }
402 },
389 ACTORS: { 403 ACTORS: {
390 PUBLIC_KEY: { min: 10, max: 5000 }, // Length 404 PUBLIC_KEY: { min: 10, max: 5000 }, // Length
391 PRIVATE_KEY: { min: 10, max: 5000 }, // Length 405 PRIVATE_KEY: { min: 10, max: 5000 }, // Length
@@ -502,6 +516,12 @@ const VIDEO_ABUSE_STATES = {
502 [VideoAbuseState.ACCEPTED]: 'Accepted' 516 [VideoAbuseState.ACCEPTED]: 'Accepted'
503} 517}
504 518
519const VIDEO_PLAYLIST_PRIVACIES = {
520 [VideoPlaylistPrivacy.PUBLIC]: 'Public',
521 [VideoPlaylistPrivacy.UNLISTED]: 'Unlisted',
522 [VideoPlaylistPrivacy.PRIVATE]: 'Private'
523}
524
505const MIMETYPES = { 525const MIMETYPES = {
506 VIDEO: { 526 VIDEO: {
507 MIMETYPE_EXT: buildVideoMimetypeExt(), 527 MIMETYPE_EXT: buildVideoMimetypeExt(),
@@ -786,6 +806,7 @@ export {
786 VIDEO_IMPORT_STATES, 806 VIDEO_IMPORT_STATES,
787 VIDEO_VIEW_LIFETIME, 807 VIDEO_VIEW_LIFETIME,
788 CONTACT_FORM_LIFETIME, 808 CONTACT_FORM_LIFETIME,
809 VIDEO_PLAYLIST_PRIVACIES,
789 buildLanguages 810 buildLanguages
790} 811}
791 812