aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/constants.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-10-24 19:41:09 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-10-26 09:11:38 +0200
commit72c7248b6fdcdb2175e726ff51b42e7555f2bd84 (patch)
tree1bfdee99dbe2392cc997edba8e314e2a8a401c72 /server/initializers/constants.ts
parent8113a93a0d9f31aa9e23702bbc31b8a76275ae22 (diff)
downloadPeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.gz
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.tar.zst
PeerTube-72c7248b6fdcdb2175e726ff51b42e7555f2bd84.zip
Add video channels
Diffstat (limited to 'server/initializers/constants.ts')
-rw-r--r--server/initializers/constants.ts23
1 files changed, 19 insertions, 4 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 132164746..54dce980f 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -10,6 +10,7 @@ import {
10 RequestEndpoint, 10 RequestEndpoint,
11 RequestVideoEventType, 11 RequestVideoEventType,
12 RequestVideoQaduType, 12 RequestVideoQaduType,
13 RemoteVideoRequestType,
13 JobState 14 JobState
14} from '../../shared/models' 15} from '../../shared/models'
15 16
@@ -35,6 +36,7 @@ const SORTABLE_COLUMNS = {
35 PODS: [ 'id', 'host', 'score', 'createdAt' ], 36 PODS: [ 'id', 'host', 'score', 'createdAt' ],
36 USERS: [ 'id', 'username', 'createdAt' ], 37 USERS: [ 'id', 'username', 'createdAt' ],
37 VIDEO_ABUSES: [ 'id', 'createdAt' ], 38 VIDEO_ABUSES: [ 'id', 'createdAt' ],
39 VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ],
38 VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ], 40 VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ],
39 BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ] 41 BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ]
40} 42}
@@ -115,6 +117,10 @@ const CONSTRAINTS_FIELDS = {
115 VIDEO_ABUSES: { 117 VIDEO_ABUSES: {
116 REASON: { min: 2, max: 300 } // Length 118 REASON: { min: 2, max: 300 } // Length
117 }, 119 },
120 VIDEO_CHANNELS: {
121 NAME: { min: 3, max: 50 }, // Length
122 DESCRIPTION: { min: 3, max: 250 } // Length
123 },
118 VIDEOS: { 124 VIDEOS: {
119 NAME: { min: 3, max: 50 }, // Length 125 NAME: { min: 3, max: 50 }, // Length
120 DESCRIPTION: { min: 3, max: 250 }, // Length 126 DESCRIPTION: { min: 3, max: 250 }, // Length
@@ -232,11 +238,20 @@ const REQUEST_ENDPOINTS: { [ id: string ]: RequestEndpoint } = {
232 VIDEOS: 'videos' 238 VIDEOS: 'videos'
233} 239}
234 240
235const REQUEST_ENDPOINT_ACTIONS: { [ id: string ]: any } = {} 241const REQUEST_ENDPOINT_ACTIONS: {
242 [ id: string ]: {
243 [ id: string ]: RemoteVideoRequestType
244 }
245} = {}
236REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = { 246REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = {
237 ADD: 'add', 247 ADD_VIDEO: 'add-video',
238 UPDATE: 'update', 248 UPDATE_VIDEO: 'update-video',
239 REMOVE: 'remove', 249 REMOVE_VIDEO: 'remove-video',
250 ADD_CHANNEL: 'add-channel',
251 UPDATE_CHANNEL: 'update-channel',
252 REMOVE_CHANNEL: 'remove-channel',
253 ADD_AUTHOR: 'add-author',
254 REMOVE_AUTHOR: 'remove-author',
240 REPORT_ABUSE: 'report-abuse' 255 REPORT_ABUSE: 'report-abuse'
241} 256}
242 257