From be587647f98a4b83ca06a61fe55c7ac5d60927c6 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 6 Jun 2016 14:15:03 +0200 Subject: Add tags support to server --- server/controllers/api/v1/videos.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'server/controllers/api/v1') 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) { magnetUri: torrent.magnetURI, author: res.locals.oauth.token.user.username, duration: videoFile.duration, - thumbnail: thumbnailName + thumbnail: thumbnailName, + tags: videoInfos.tags } Videos.add(videoData, function (err, insertedVideo) { @@ -156,7 +157,7 @@ function addVideo (req, res, next) { return callback(null) } - ], function (err) { + ], function andFinally (err) { if (err) { logger.error('Cannot insert the video.') return next(err) @@ -228,7 +229,7 @@ function removeVideo (req, res, next) { return callback(null) } - ], function (err) { + ], function andFinally (err) { if (err) { logger.error('Errors when removed the video.', { error: err }) return next(err) @@ -259,6 +260,7 @@ function getFormatedVideo (videoObj) { magnetUri: videoObj.magnetUri, author: videoObj.author, duration: videoObj.duration, + tags: videoObj.tags, thumbnailPath: constants.THUMBNAILS_STATIC_PATH + '/' + videoObj.thumbnail, createdDate: videoObj.createdDate } -- cgit v1.2.3