aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-06-06 14:15:03 +0200
committerChocobozzz <florian.bigard@gmail.com>2016-06-06 14:15:03 +0200
commitbe587647f98a4b83ca06a61fe55c7ac5d60927c6 (patch)
tree8a28a1cb9c9a06d80803ecd3fa00aa6767bb3f8b /server/controllers/api
parent8483b2216454afdb88f6aa53cad5eecd8c394bc0 (diff)
downloadPeerTube-be587647f98a4b83ca06a61fe55c7ac5d60927c6.tar.gz
PeerTube-be587647f98a4b83ca06a61fe55c7ac5d60927c6.tar.zst
PeerTube-be587647f98a4b83ca06a61fe55c7ac5d60927c6.zip
Add tags support to server
Diffstat (limited to 'server/controllers/api')
-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 }