X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Fapi%2Fvideos.js;h=3d616e33ddb7ebc5fde16c07aa6a291130380796;hb=31b59b477459d4f26ed8ef089a0e5553fb6a332b;hp=8c69ff4e5b9dd31ded315e5b9d35c013d20c8abf;hpb=6e07c3de88791a0b342e0cc319590048117f9c2d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/api/videos.js b/server/controllers/api/videos.js index 8c69ff4e5..3d616e33d 100644 --- a/server/controllers/api/videos.js +++ b/server/controllers/api/videos.js @@ -46,6 +46,7 @@ const storage = multer.diskStorage({ const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCount: 1 }]) router.get('/categories', listVideoCategories) +router.get('/licences', listVideoLicences) router.get('/abuse', oAuth.authenticate, @@ -116,6 +117,10 @@ function listVideoCategories (req, res, next) { res.json(constants.VIDEO_CATEGORIES) } +function listVideoLicences (req, res, next) { + res.json(constants.VIDEO_LICENCES) +} + function rateVideoRetryWrapper (req, res, next) { const options = { arguments: [ req, res ], @@ -307,6 +312,8 @@ function addVideo (req, res, videoFile, finalCallback) { remoteId: null, extname: path.extname(videoFile.filename), category: videoInfos.category, + licence: videoInfos.licence, + nsfw: videoInfos.nsfw, description: videoInfos.description, duration: videoFile.duration, authorId: author.id @@ -421,6 +428,8 @@ function updateVideo (req, res, finalCallback) { if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name) if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category) + if (videoInfosToUpdate.licence) videoInstance.set('licence', videoInfosToUpdate.licence) + if (videoInfosToUpdate.nsfw) videoInstance.set('nsfw', videoInfosToUpdate.nsfw) if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) videoInstance.save(options).asCallback(function (err) {