1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 10:19:35 +02:00

Add tags support to server

This commit is contained in:
Chocobozzz 2016-06-06 14:15:03 +02:00
parent 8483b22164
commit be587647f9
14 changed files with 275 additions and 71 deletions

View file

@ -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
}