aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-17 20:59:16 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-17 20:59:16 +0100
commitda691c46df2f3c542d4fffaaa99ef18b6ef71f53 (patch)
treee6ce2dd25bc66e6268e839e96009576f4038758b /server/lib
parent62f4ef413c8ef4269e7cdc21dea0e99ab2191201 (diff)
downloadPeerTube-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.js10
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')
12const logger = require('../helpers/logger') 12const logger = require('../helpers/logger')
13const requests = require('../helpers/requests') 13const requests = require('../helpers/requests')
14 14
15const ENDPOINT_ACTIONS = constants.REQUEST_ENDPOINT_ACTIONS[constants.REQUEST_ENDPOINTS.VIDEOS]
16
15const friends = { 17const friends = {
16 addVideoToFriends, 18 addVideoToFriends,
17 updateVideoToFriends, 19 updateVideoToFriends,
@@ -26,7 +28,7 @@ const friends = {
26 28
27function addVideoToFriends (videoData, transaction, callback) { 29function 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
37function updateVideoToFriends (videoData, transaction, callback) { 39function 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
47function removeVideoToFriends (videoParams) { 49function 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
56function reportAbuseVideoToFriend (reportData, video) { 58function 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 ]