diff options
Diffstat (limited to 'server/controllers/api/remote.js')
-rw-r--r-- | server/controllers/api/remote.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/server/controllers/api/remote.js b/server/controllers/api/remote.js index 94808693d..4085deb2d 100644 --- a/server/controllers/api/remote.js +++ b/server/controllers/api/remote.js | |||
@@ -30,7 +30,7 @@ module.exports = router | |||
30 | 30 | ||
31 | function remoteVideos (req, res, next) { | 31 | function remoteVideos (req, res, next) { |
32 | const requests = req.body.data | 32 | const requests = req.body.data |
33 | const fromUrl = req.body.signature.url | 33 | const fromHost = req.body.signature.host |
34 | 34 | ||
35 | // We need to process in the same order to keep consistency | 35 | // We need to process in the same order to keep consistency |
36 | // TODO: optimization | 36 | // TODO: optimization |
@@ -40,7 +40,7 @@ function remoteVideos (req, res, next) { | |||
40 | if (request.type === 'add') { | 40 | if (request.type === 'add') { |
41 | addRemoteVideo(videoData, callbackEach) | 41 | addRemoteVideo(videoData, callbackEach) |
42 | } else if (request.type === 'remove') { | 42 | } else if (request.type === 'remove') { |
43 | removeRemoteVideo(videoData, fromUrl, callbackEach) | 43 | removeRemoteVideo(videoData, fromHost, callbackEach) |
44 | } else { | 44 | } else { |
45 | logger.error('Unkown remote request type %s.', request.type) | 45 | logger.error('Unkown remote request type %s.', request.type) |
46 | } | 46 | } |
@@ -62,16 +62,16 @@ function addRemoteVideo (videoToCreateData, callback) { | |||
62 | video.save(callback) | 62 | video.save(callback) |
63 | } | 63 | } |
64 | 64 | ||
65 | function removeRemoteVideo (videoToRemoveData, fromUrl, callback) { | 65 | function removeRemoteVideo (videoToRemoveData, fromHost, callback) { |
66 | // We need the list because we have to remove some other stuffs (thumbnail etc) | 66 | // We need the list because we have to remove some other stuffs (thumbnail etc) |
67 | Video.listByUrlAndRemoteId(fromUrl, videoToRemoveData.remoteId, function (err, videosList) { | 67 | Video.listByHostAndRemoteId(fromHost, videoToRemoveData.remoteId, function (err, videosList) { |
68 | if (err) { | 68 | if (err) { |
69 | logger.error('Cannot list videos from url and magnets.', { error: err }) | 69 | logger.error('Cannot list videos from host and magnets.', { error: err }) |
70 | return callback(err) | 70 | return callback(err) |
71 | } | 71 | } |
72 | 72 | ||
73 | if (videosList.length === 0) { | 73 | if (videosList.length === 0) { |
74 | logger.error('No remote video was found for this pod.', { magnetUri: videoToRemoveData.magnetUri, podUrl: fromUrl }) | 74 | logger.error('No remote video was found for this pod.', { magnetUri: videoToRemoveData.magnetUri, podHost: fromHost }) |
75 | } | 75 | } |
76 | 76 | ||
77 | each(videosList, function (video, callbackEach) { | 77 | each(videosList, function (video, callbackEach) { |