1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Server: set manually the post host of a remote video throught the

signature
This commit is contained in:
Chocobozzz 2016-11-27 11:09:05 +01:00
parent e903c2f3b7
commit 437cf8b531
4 changed files with 4 additions and 5 deletions

View file

@ -38,7 +38,7 @@ function remoteVideos (req, res, next) {
const videoData = request.data
if (request.type === 'add') {
addRemoteVideo(videoData, callbackEach)
addRemoteVideo(videoData, fromHost, callbackEach)
} else if (request.type === 'remove') {
removeRemoteVideo(videoData, fromHost, callbackEach)
} else {
@ -52,10 +52,11 @@ function remoteVideos (req, res, next) {
return res.type('json').status(204).end()
}
function addRemoteVideo (videoToCreateData, callback) {
function addRemoteVideo (videoToCreateData, fromHost, callback) {
logger.debug('Adding remote video "%s".', videoToCreateData.name)
const video = new Video(videoToCreateData)
video.podHost = fromHost
Video.generateThumbnailFromBase64(video, videoToCreateData.thumbnailBase64, function (err) {
if (err) {
logger.error('Cannot generate thumbnail from base 64 data.', { error: err })