Server: set manually the post host of a remote video throught the
signature
This commit is contained in:
parent
e903c2f3b7
commit
437cf8b531
|
@ -227,7 +227,7 @@ module.exports = function (env) {
|
||||||
[/\*/, /(?:)/],
|
[/\*/, /(?:)/],
|
||||||
[/\[?\(?/, /(?:)/]
|
[/\[?\(?/, /(?:)/]
|
||||||
],
|
],
|
||||||
customAttrAssign: [/\)?\]?=/]
|
customAttrAssign: [/\)?]?=/]
|
||||||
},
|
},
|
||||||
|
|
||||||
// FIXME: Remove
|
// FIXME: Remove
|
||||||
|
|
|
@ -38,7 +38,7 @@ function remoteVideos (req, res, next) {
|
||||||
const videoData = request.data
|
const videoData = request.data
|
||||||
|
|
||||||
if (request.type === 'add') {
|
if (request.type === 'add') {
|
||||||
addRemoteVideo(videoData, callbackEach)
|
addRemoteVideo(videoData, fromHost, callbackEach)
|
||||||
} else if (request.type === 'remove') {
|
} else if (request.type === 'remove') {
|
||||||
removeRemoteVideo(videoData, fromHost, callbackEach)
|
removeRemoteVideo(videoData, fromHost, callbackEach)
|
||||||
} else {
|
} else {
|
||||||
|
@ -52,10 +52,11 @@ function remoteVideos (req, res, next) {
|
||||||
return res.type('json').status(204).end()
|
return res.type('json').status(204).end()
|
||||||
}
|
}
|
||||||
|
|
||||||
function addRemoteVideo (videoToCreateData, callback) {
|
function addRemoteVideo (videoToCreateData, fromHost, callback) {
|
||||||
logger.debug('Adding remote video "%s".', videoToCreateData.name)
|
logger.debug('Adding remote video "%s".', videoToCreateData.name)
|
||||||
|
|
||||||
const video = new Video(videoToCreateData)
|
const video = new Video(videoToCreateData)
|
||||||
|
video.podHost = fromHost
|
||||||
Video.generateThumbnailFromBase64(video, videoToCreateData.thumbnailBase64, function (err) {
|
Video.generateThumbnailFromBase64(video, videoToCreateData.thumbnailBase64, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
logger.error('Cannot generate thumbnail from base 64 data.', { error: err })
|
logger.error('Cannot generate thumbnail from base 64 data.', { error: err })
|
||||||
|
|
|
@ -33,7 +33,6 @@ function isEachRemoteVideosValid (requests) {
|
||||||
isVideoDurationValid(video.duration) &&
|
isVideoDurationValid(video.duration) &&
|
||||||
isVideoMagnetValid(video.magnet) &&
|
isVideoMagnetValid(video.magnet) &&
|
||||||
isVideoNameValid(video.name) &&
|
isVideoNameValid(video.name) &&
|
||||||
isVideoPodHostValid(video.podHost) &&
|
|
||||||
isVideoTagsValid(video.tags) &&
|
isVideoTagsValid(video.tags) &&
|
||||||
isVideoThumbnail64Valid(video.thumbnailBase64) &&
|
isVideoThumbnail64Valid(video.thumbnailBase64) &&
|
||||||
isVideoRemoteIdValid(video.remoteId)
|
isVideoRemoteIdValid(video.remoteId)
|
||||||
|
|
|
@ -243,7 +243,6 @@ function toRemoteJSON (callback) {
|
||||||
thumbnailBase64: new Buffer(thumbnailData).toString('base64'),
|
thumbnailBase64: new Buffer(thumbnailData).toString('base64'),
|
||||||
tags: self.tags,
|
tags: self.tags,
|
||||||
createdDate: self.createdDate,
|
createdDate: self.createdDate,
|
||||||
podHost: self.podHost,
|
|
||||||
extname: self.extname
|
extname: self.extname
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue