aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-27 11:09:05 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-27 11:09:05 +0100
commit437cf8b531652a4b101ec279dea7661e8dfb8cda (patch)
tree0d2a3a49515e2ef3772b6425f25f08289216162d /server/controllers/api
parente903c2f3b7a3e63e58d9ef5934bcfd8f186b021a (diff)
downloadPeerTube-437cf8b531652a4b101ec279dea7661e8dfb8cda.tar.gz
PeerTube-437cf8b531652a4b101ec279dea7661e8dfb8cda.tar.zst
PeerTube-437cf8b531652a4b101ec279dea7661e8dfb8cda.zip
Server: set manually the post host of a remote video throught the
signature
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/remote.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/controllers/api/remote.js b/server/controllers/api/remote.js
index 2d0db51c0..35f386ba6 100644
--- a/server/controllers/api/remote.js
+++ b/server/controllers/api/remote.js
@@ -38,7 +38,7 @@ function remoteVideos (req, res, next) {
38 const videoData = request.data 38 const videoData = request.data
39 39
40 if (request.type === 'add') { 40 if (request.type === 'add') {
41 addRemoteVideo(videoData, callbackEach) 41 addRemoteVideo(videoData, fromHost, callbackEach)
42 } else if (request.type === 'remove') { 42 } else if (request.type === 'remove') {
43 removeRemoteVideo(videoData, fromHost, callbackEach) 43 removeRemoteVideo(videoData, fromHost, callbackEach)
44 } else { 44 } else {
@@ -52,10 +52,11 @@ function remoteVideos (req, res, next) {
52 return res.type('json').status(204).end() 52 return res.type('json').status(204).end()
53} 53}
54 54
55function addRemoteVideo (videoToCreateData, callback) { 55function addRemoteVideo (videoToCreateData, fromHost, callback) {
56 logger.debug('Adding remote video "%s".', videoToCreateData.name) 56 logger.debug('Adding remote video "%s".', videoToCreateData.name)
57 57
58 const video = new Video(videoToCreateData) 58 const video = new Video(videoToCreateData)
59 video.podHost = fromHost
59 Video.generateThumbnailFromBase64(video, videoToCreateData.thumbnailBase64, function (err) { 60 Video.generateThumbnailFromBase64(video, videoToCreateData.thumbnailBase64, function (err) {
60 if (err) { 61 if (err) {
61 logger.error('Cannot generate thumbnail from base 64 data.', { error: err }) 62 logger.error('Cannot generate thumbnail from base 64 data.', { error: err })