]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/constants.ts
Fix join in video events
[github/Chocobozzz/PeerTube.git] / server / initializers / constants.ts
index 491fb78f96c26367955b9d819c4ba2c030db9bdf..71012f3a3d932ad9e407d323d4fbaee4b6ca6e96 100644 (file)
@@ -10,12 +10,13 @@ import {
   RequestEndpoint,
   RequestVideoEventType,
   RequestVideoQaduType,
+  RemoteVideoRequestType,
   JobState
 } from '../../shared/models'
 
 // ---------------------------------------------------------------------------
 
-const LAST_MIGRATION_VERSION = 75
+const LAST_MIGRATION_VERSION = 80
 
 // ---------------------------------------------------------------------------
 
@@ -32,8 +33,10 @@ const SEARCHABLE_COLUMNS = {
 
 // Sortable columns per schema
 const SORTABLE_COLUMNS = {
+  PODS: [ 'id', 'host', 'score', 'createdAt' ],
   USERS: [ 'id', 'username', 'createdAt' ],
   VIDEO_ABUSES: [ 'id', 'createdAt' ],
+  VIDEO_CHANNELS: [ 'id', 'name', 'updatedAt', 'createdAt' ],
   VIDEOS: [ 'name', 'duration', 'createdAt', 'views', 'likes' ],
   BLACKLISTS: [ 'id', 'name', 'duration', 'views', 'likes', 'dislikes', 'uuid', 'createdAt' ]
 }
@@ -114,6 +117,10 @@ const CONSTRAINTS_FIELDS = {
   VIDEO_ABUSES: {
     REASON: { min: 2, max: 300 } // Length
   },
+  VIDEO_CHANNELS: {
+    NAME: { min: 3, max: 50 }, // Length
+    DESCRIPTION: { min: 3, max: 250 } // Length
+  },
   VIDEOS: {
     NAME: { min: 3, max: 50 }, // Length
     DESCRIPTION: { min: 3, max: 250 }, // Length
@@ -231,11 +238,20 @@ const REQUEST_ENDPOINTS: { [ id: string ]: RequestEndpoint } = {
   VIDEOS: 'videos'
 }
 
-const REQUEST_ENDPOINT_ACTIONS: { [ id: string ]: any } = {}
+const REQUEST_ENDPOINT_ACTIONS: {
+  [ id: string ]: {
+    [ id: string ]: RemoteVideoRequestType
+  }
+} = {}
 REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = {
-  ADD: 'add',
-  UPDATE: 'update',
-  REMOVE: 'remove',
+  ADD_VIDEO: 'add-video',
+  UPDATE_VIDEO: 'update-video',
+  REMOVE_VIDEO: 'remove-video',
+  ADD_CHANNEL: 'add-channel',
+  UPDATE_CHANNEL: 'update-channel',
+  REMOVE_CHANNEL: 'remove-channel',
+  ADD_AUTHOR: 'add-author',
+  REMOVE_AUTHOR: 'remove-author',
   REPORT_ABUSE: 'report-abuse'
 }