]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Server: set manually the post host of a remote video throught the
authorChocobozzz <florian.bigard@gmail.com>
Sun, 27 Nov 2016 10:09:05 +0000 (11:09 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Sun, 27 Nov 2016 10:09:05 +0000 (11:09 +0100)
signature

client/config/webpack.prod.js
server/controllers/api/remote.js
server/helpers/custom-validators/videos.js
server/models/video.js

index ce6886af668ec185a59b2df79cb95ae3256e49b6..98507ff8e65404af41a0d1b7770af536e07acc5e 100644 (file)
@@ -227,7 +227,7 @@ module.exports = function (env) {
               [/\*/, /(?:)/],
               [/\[?\(?/, /(?:)/]
             ],
-            customAttrAssign: [/\)?\]?=/]
+            customAttrAssign: [/\)?]?=/]
           },
 
           // FIXME: Remove
index 2d0db51c02e47435a10f8bdbacf718c10bfd26b8..35f386ba693cb4c1d9a7379d361c7adccba71471 100644 (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 })
index 4a6a623267814bd1727a7417fc76c0e4edf5b672..1a7753265255994d592e1d6b44b4e5d00dde7f94 100644 (file)
@@ -33,7 +33,6 @@ function isEachRemoteVideosValid (requests) {
         isVideoDurationValid(video.duration) &&
         isVideoMagnetValid(video.magnet) &&
         isVideoNameValid(video.name) &&
-        isVideoPodHostValid(video.podHost) &&
         isVideoTagsValid(video.tags) &&
         isVideoThumbnail64Valid(video.thumbnailBase64) &&
         isVideoRemoteIdValid(video.remoteId)
index 3d7c16f0d0dfd5cf5169d68cdff9e2f07fc3a9e0..330067cdfa6e892776692f1787fd70efe22f2ea4 100644 (file)
@@ -243,7 +243,6 @@ function toRemoteJSON (callback) {
       thumbnailBase64: new Buffer(thumbnailData).toString('base64'),
       tags: self.tags,
       createdDate: self.createdDate,
-      podHost: self.podHost,
       extname: self.extname
     }