aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/friends.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-29 19:07:05 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-29 19:07:05 +0100
commit7b1f49de22c40ae121ddb3c399b2540ba56fd414 (patch)
tree269e5dc7c2ebe4147319f1ee8e8b7f3c74549149 /server/lib/friends.js
parent4ff0d86208dafbdd07beb6286fd93c795db8a95f (diff)
downloadPeerTube-7b1f49de22c40ae121ddb3c399b2540ba56fd414.tar.gz
PeerTube-7b1f49de22c40ae121ddb3c399b2540ba56fd414.tar.zst
PeerTube-7b1f49de22c40ae121ddb3c399b2540ba56fd414.zip
Server: add ability to update a video
Diffstat (limited to 'server/lib/friends.js')
-rw-r--r--server/lib/friends.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/lib/friends.js b/server/lib/friends.js
index ad9e4fdae..589b79660 100644
--- a/server/lib/friends.js
+++ b/server/lib/friends.js
@@ -14,6 +14,7 @@ const requests = require('../helpers/requests')
14 14
15const friends = { 15const friends = {
16 addVideoToFriends, 16 addVideoToFriends,
17 updateVideoToFriends,
17 hasFriends, 18 hasFriends,
18 getMyCertificate, 19 getMyCertificate,
19 makeFriends, 20 makeFriends,
@@ -26,6 +27,10 @@ function addVideoToFriends (video) {
26 createRequest('add', constants.REQUEST_ENDPOINTS.VIDEOS, video) 27 createRequest('add', constants.REQUEST_ENDPOINTS.VIDEOS, video)
27} 28}
28 29
30function updateVideoToFriends (video) {
31 createRequest('update', constants.REQUEST_ENDPOINTS.VIDEOS, video)
32}
33
29function hasFriends (callback) { 34function hasFriends (callback) {
30 db.Pod.countAll(function (err, count) { 35 db.Pod.countAll(function (err, count) {
31 if (err) return callback(err) 36 if (err) return callback(err)
@@ -127,7 +132,7 @@ function sendOwnedVideosToPod (podId) {
127 } 132 }
128 133
129 videosList.forEach(function (video) { 134 videosList.forEach(function (video) {
130 video.toRemoteJSON(function (err, remoteVideo) { 135 video.toAddRemoteJSON(function (err, remoteVideo) {
131 if (err) { 136 if (err) {
132 logger.error('Cannot convert video to remote.', { error: err }) 137 logger.error('Cannot convert video to remote.', { error: err })
133 // Don't break the process 138 // Don't break the process