aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/v1/videos.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/v1/videos.js')
-rw-r--r--server/controllers/api/v1/videos.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/controllers/api/v1/videos.js b/server/controllers/api/v1/videos.js
index 7f59dd232..5449cbcfa 100644
--- a/server/controllers/api/v1/videos.js
+++ b/server/controllers/api/v1/videos.js
@@ -115,7 +115,8 @@ function addVideo (req, res, next) {
115 magnetUri: torrent.magnetURI, 115 magnetUri: torrent.magnetURI,
116 author: res.locals.oauth.token.user.username, 116 author: res.locals.oauth.token.user.username,
117 duration: videoFile.duration, 117 duration: videoFile.duration,
118 thumbnail: thumbnailName 118 thumbnail: thumbnailName,
119 tags: videoInfos.tags
119 } 120 }
120 121
121 Videos.add(videoData, function (err, insertedVideo) { 122 Videos.add(videoData, function (err, insertedVideo) {
@@ -156,7 +157,7 @@ function addVideo (req, res, next) {
156 return callback(null) 157 return callback(null)
157 } 158 }
158 159
159 ], function (err) { 160 ], function andFinally (err) {
160 if (err) { 161 if (err) {
161 logger.error('Cannot insert the video.') 162 logger.error('Cannot insert the video.')
162 return next(err) 163 return next(err)
@@ -228,7 +229,7 @@ function removeVideo (req, res, next) {
228 229
229 return callback(null) 230 return callback(null)
230 } 231 }
231 ], function (err) { 232 ], function andFinally (err) {
232 if (err) { 233 if (err) {
233 logger.error('Errors when removed the video.', { error: err }) 234 logger.error('Errors when removed the video.', { error: err })
234 return next(err) 235 return next(err)
@@ -259,6 +260,7 @@ function getFormatedVideo (videoObj) {
259 magnetUri: videoObj.magnetUri, 260 magnetUri: videoObj.magnetUri,
260 author: videoObj.author, 261 author: videoObj.author,
261 duration: videoObj.duration, 262 duration: videoObj.duration,
263 tags: videoObj.tags,
262 thumbnailPath: constants.THUMBNAILS_STATIC_PATH + '/' + videoObj.thumbnail, 264 thumbnailPath: constants.THUMBNAILS_STATIC_PATH + '/' + videoObj.thumbnail,
263 createdDate: videoObj.createdDate 265 createdDate: videoObj.createdDate
264 } 266 }