From 0d0e8dd0904b380b70e19ebcb4763d65601c4632 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 10 Nov 2017 14:34:45 +0100 Subject: Continue activitypub --- server/initializers/constants.ts | 56 ++++++++++++---------------------------- 1 file changed, 16 insertions(+), 40 deletions(-) (limited to 'server/initializers') diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index cb838cf16..e1f877e80 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -203,6 +203,12 @@ const VIDEO_PRIVACIES = { [VideoPrivacy.PRIVATE]: 'Private' } +const VIDEO_MIMETYPE_EXT = { + 'video/webm': 'webm', + 'video/ogg': 'ogv', + 'video/mp4': 'mp4' +} + // --------------------------------------------------------------------------- // Score a pod has when we create it as a friend @@ -212,7 +218,14 @@ const FRIEND_SCORE = { } const ACTIVITY_PUB = { - COLLECTION_ITEMS_PER_PAGE: 10 + COLLECTION_ITEMS_PER_PAGE: 10, + VIDEO_URL_MIME_TYPES: [ + 'video/mp4', + 'video/webm', + 'video/ogg', + 'application/x-bittorrent', + 'application/x-bittorrent;x-scheme-handler/magnet' + ] } // --------------------------------------------------------------------------- @@ -245,42 +258,6 @@ const REQUESTS_VIDEO_EVENT_LIMIT_PER_POD = 50 // Number of requests to retry for replay requests module const RETRY_REQUESTS = 5 -const REQUEST_ENDPOINTS: { [ id: string ]: RequestEndpoint } = { - VIDEOS: 'videos' -} - -const REQUEST_ENDPOINT_ACTIONS: { - [ id: string ]: { - [ id: string ]: RemoteVideoRequestType - } -} = {} -REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = { - 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' -} - -const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu' -const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events' - -const REQUEST_VIDEO_QADU_TYPES: { [ id: string ]: RequestVideoQaduType } = { - LIKES: 'likes', - DISLIKES: 'dislikes', - VIEWS: 'views' -} - -const REQUEST_VIDEO_EVENT_TYPES: { [ id: string ]: RequestVideoEventType } = { - LIKES: 'likes', - DISLIKES: 'dislikes', - VIEWS: 'views' -} - const REMOTE_SCHEME = { HTTP: 'https', WS: 'wss' @@ -306,8 +283,6 @@ let JOBS_FETCHING_INTERVAL = 60000 // --------------------------------------------------------------------------- -// const SIGNATURE_ALGORITHM = 'RSA-SHA256' -// const SIGNATURE_ENCODING = 'hex' const PRIVATE_RSA_KEY_SIZE = 2048 // Password encryption @@ -412,5 +387,6 @@ export { VIDEO_LANGUAGES, VIDEO_PRIVACIES, VIDEO_LICENCES, - VIDEO_RATE_TYPES + VIDEO_RATE_TYPES, + VIDEO_MIMETYPE_EXT } -- cgit v1.2.3