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

Server: add licence video attribute

This commit is contained in:
Chocobozzz 2017-03-27 20:53:11 +02:00
parent 2897488928
commit 6f0c39e2de
14 changed files with 209 additions and 3 deletions

View file

@ -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,7 @@ function addVideo (req, res, videoFile, finalCallback) {
remoteId: null,
extname: path.extname(videoFile.filename),
category: videoInfos.category,
licence: videoInfos.licence,
description: videoInfos.description,
duration: videoFile.duration,
authorId: author.id
@ -421,6 +427,7 @@ 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.description) videoInstance.set('description', videoInfosToUpdate.description)
videoInstance.save(options).asCallback(function (err) {