]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Server: fix requests endpoints
authorChocobozzz <florian.bigard@gmail.com>
Sat, 4 Mar 2017 08:48:35 +0000 (09:48 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Sat, 4 Mar 2017 08:48:35 +0000 (09:48 +0100)
server/initializers/constants.js
server/lib/request-video-event-scheduler.js
server/lib/request-video-qadu-scheduler.js

index e332291637615b7891478b49813a6f1a91424ea0..2d5bb84cc66bc417c019b2e79ca94faccc271d9e 100644 (file)
@@ -134,10 +134,9 @@ const REQUESTS_VIDEO_EVENT_LIMIT_PER_POD = 50
 const RETRY_REQUESTS = 5
 
 const REQUEST_ENDPOINTS = {
-  VIDEOS: 'videos',
-  QADU: 'videos/qadu',
-  EVENT: 'videos/events'
+  VIDEOS: 'videos'
 }
+
 const REQUEST_ENDPOINT_ACTIONS = {}
 REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = {
   ADD: 'add',
@@ -146,6 +145,9 @@ REQUEST_ENDPOINT_ACTIONS[REQUEST_ENDPOINTS.VIDEOS] = {
   REPORT_ABUSE: 'report-abuse'
 }
 
+const REQUEST_VIDEO_QADU_ENDPOINT = 'videos/qadu'
+const REQUEST_VIDEO_EVENT_ENDPOINT = 'videos/events'
+
 const REQUEST_VIDEO_QADU_TYPES = {
   LIKES: 'likes',
   DISLIKES: 'dislikes',
@@ -227,16 +229,18 @@ module.exports = {
   REMOTE_SCHEME,
   REQUEST_ENDPOINT_ACTIONS,
   REQUEST_ENDPOINTS,
+  REQUEST_VIDEO_EVENT_ENDPOINT,
   REQUEST_VIDEO_EVENT_TYPES,
+  REQUEST_VIDEO_QADU_ENDPOINT,
   REQUEST_VIDEO_QADU_TYPES,
   REQUESTS_IN_PARALLEL,
   REQUESTS_INTERVAL,
   REQUESTS_LIMIT_PER_POD,
   REQUESTS_LIMIT_PODS,
-  REQUESTS_VIDEO_QADU_LIMIT_PER_POD,
-  REQUESTS_VIDEO_QADU_LIMIT_PODS,
   REQUESTS_VIDEO_EVENT_LIMIT_PER_POD,
   REQUESTS_VIDEO_EVENT_LIMIT_PODS,
+  REQUESTS_VIDEO_QADU_LIMIT_PER_POD,
+  REQUESTS_VIDEO_QADU_LIMIT_PODS,
   RETRY_REQUESTS,
   SEARCHABLE_COLUMNS,
   SIGNATURE_ALGORITHM,
index f178df49ee4269e9903b59656268b0a17c65de6d..c7631253ab0ca3dc1d3f919fea10cd19cc3df2db 100644 (file)
@@ -45,7 +45,7 @@ module.exports = class RequestVideoEventScheduler extends BaseRequestScheduler {
         if (!requestsToMakeGrouped[toPodId]) {
           requestsToMakeGrouped[toPodId] = {
             toPod: eventToProcess.pod,
-            endpoint: constants.REQUEST_ENDPOINTS.EVENT,
+            endpoint: constants.REQUEST_VIDEO_EVENT_ENDPOINT,
             ids: [], // request ids, to delete them from the DB in the future
             datas: [] // requests data
           }
index bfccc5234441b62ce7b12a9632e5dfd8ce48af01..ac50cfc111e7495f50bfe0585996146a8b9e85ad 100644 (file)
@@ -37,7 +37,7 @@ module.exports = class RequestVideoQaduScheduler extends BaseRequestScheduler {
         if (!requestsToMakeGrouped[hashKey]) {
           requestsToMakeGrouped[hashKey] = {
             toPod: pod,
-            endpoint: constants.REQUEST_ENDPOINTS.QADU,
+            endpoint: constants.REQUEST_VIDEO_QADU_ENDPOINT,
             ids: [], // request ids, to delete them from the DB in the future
             datas: [], // requests data
             videos: {}