+function convertVideoToRemote (video, callback) {
+ fs.readFile(thumbnailsDir + video.thumbnail, function (err, thumbnailData) {
+ if (err) {
+ logger.error('Cannot read the thumbnail of the video')
+ return callback(err)
+ }
+
+ const remoteVideo = {
+ name: video.name,
+ description: video.description,
+ magnetUri: video.magnetUri,
+ author: video.author,
+ duration: video.duration,
+ thumbnailBase64: new Buffer(thumbnailData).toString('base64'),
+ tags: video.tags,
+ createdDate: video.createdDate,
+ podUrl: video.podUrl
+ }
+
+ return callback(null, remoteVideo)
+ })
+}
+