diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-01-17 20:59:16 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-01-17 20:59:16 +0100 |
commit | da691c46df2f3c542d4fffaaa99ef18b6ef71f53 (patch) | |
tree | e6ce2dd25bc66e6268e839e96009576f4038758b /server/lib | |
parent | 62f4ef413c8ef4269e7cdc21dea0e99ab2191201 (diff) | |
download | PeerTube-da691c46df2f3c542d4fffaaa99ef18b6ef71f53.tar.gz PeerTube-da691c46df2f3c542d4fffaaa99ef18b6ef71f53.tar.zst PeerTube-da691c46df2f3c542d4fffaaa99ef18b6ef71f53.zip |
Server: remote video validators refractoring
Diffstat (limited to 'server/lib')
-rw-r--r-- | server/lib/friends.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js index f0575ff2f..f634aedbb 100644 --- a/server/lib/friends.js +++ b/server/lib/friends.js | |||
@@ -12,6 +12,8 @@ const db = require('../initializers/database') | |||
12 | const logger = require('../helpers/logger') | 12 | const logger = require('../helpers/logger') |
13 | const requests = require('../helpers/requests') | 13 | const requests = require('../helpers/requests') |
14 | 14 | ||
15 | const ENDPOINT_ACTIONS = constants.REQUEST_ENDPOINT_ACTIONS[constants.REQUEST_ENDPOINTS.VIDEOS] | ||
16 | |||
15 | const friends = { | 17 | const friends = { |
16 | addVideoToFriends, | 18 | addVideoToFriends, |
17 | updateVideoToFriends, | 19 | updateVideoToFriends, |
@@ -26,7 +28,7 @@ const friends = { | |||
26 | 28 | ||
27 | function addVideoToFriends (videoData, transaction, callback) { | 29 | function addVideoToFriends (videoData, transaction, callback) { |
28 | const options = { | 30 | const options = { |
29 | type: 'add', | 31 | type: ENDPOINT_ACTIONS.ADD, |
30 | endpoint: constants.REQUEST_ENDPOINTS.VIDEOS, | 32 | endpoint: constants.REQUEST_ENDPOINTS.VIDEOS, |
31 | data: videoData, | 33 | data: videoData, |
32 | transaction | 34 | transaction |
@@ -36,7 +38,7 @@ function addVideoToFriends (videoData, transaction, callback) { | |||
36 | 38 | ||
37 | function updateVideoToFriends (videoData, transaction, callback) { | 39 | function updateVideoToFriends (videoData, transaction, callback) { |
38 | const options = { | 40 | const options = { |
39 | type: 'update', | 41 | type: ENDPOINT_ACTIONS.UPDATE, |
40 | endpoint: constants.REQUEST_ENDPOINTS.VIDEOS, | 42 | endpoint: constants.REQUEST_ENDPOINTS.VIDEOS, |
41 | data: videoData, | 43 | data: videoData, |
42 | transaction | 44 | transaction |
@@ -46,7 +48,7 @@ function updateVideoToFriends (videoData, transaction, callback) { | |||
46 | 48 | ||
47 | function removeVideoToFriends (videoParams) { | 49 | function removeVideoToFriends (videoParams) { |
48 | const options = { | 50 | const options = { |
49 | type: 'remove', | 51 | type: ENDPOINT_ACTIONS.REMOVE, |
50 | endpoint: constants.REQUEST_ENDPOINTS.VIDEOS, | 52 | endpoint: constants.REQUEST_ENDPOINTS.VIDEOS, |
51 | data: videoParams | 53 | data: videoParams |
52 | } | 54 | } |
@@ -55,7 +57,7 @@ function removeVideoToFriends (videoParams) { | |||
55 | 57 | ||
56 | function reportAbuseVideoToFriend (reportData, video) { | 58 | function reportAbuseVideoToFriend (reportData, video) { |
57 | const options = { | 59 | const options = { |
58 | type: 'report-abuse', | 60 | type: ENDPOINT_ACTIONS.REPORT_ABUSE, |
59 | endpoint: constants.REQUEST_ENDPOINTS.VIDEOS, | 61 | endpoint: constants.REQUEST_ENDPOINTS.VIDEOS, |
60 | data: reportData, | 62 | data: reportData, |
61 | toIds: [ video.Author.podId ] | 63 | toIds: [ video.Author.podId ] |