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 {
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 })
isVideoDurationValid(video.duration) &&
isVideoMagnetValid(video.magnet) &&
isVideoNameValid(video.name) &&
- isVideoPodHostValid(video.podHost) &&
isVideoTagsValid(video.tags) &&
isVideoThumbnail64Valid(video.thumbnailBase64) &&
isVideoRemoteIdValid(video.remoteId)