diff options
Diffstat (limited to 'server/controllers/api/videos.js')
-rw-r--r-- | server/controllers/api/videos.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/server/controllers/api/videos.js b/server/controllers/api/videos.js index 8c69ff4e5..375e89387 100644 --- a/server/controllers/api/videos.js +++ b/server/controllers/api/videos.js | |||
@@ -46,6 +46,7 @@ const storage = multer.diskStorage({ | |||
46 | const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCount: 1 }]) | 46 | const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCount: 1 }]) |
47 | 47 | ||
48 | router.get('/categories', listVideoCategories) | 48 | router.get('/categories', listVideoCategories) |
49 | router.get('/licences', listVideoLicences) | ||
49 | 50 | ||
50 | router.get('/abuse', | 51 | router.get('/abuse', |
51 | oAuth.authenticate, | 52 | oAuth.authenticate, |
@@ -116,6 +117,10 @@ function listVideoCategories (req, res, next) { | |||
116 | res.json(constants.VIDEO_CATEGORIES) | 117 | res.json(constants.VIDEO_CATEGORIES) |
117 | } | 118 | } |
118 | 119 | ||
120 | function listVideoLicences (req, res, next) { | ||
121 | res.json(constants.VIDEO_LICENCES) | ||
122 | } | ||
123 | |||
119 | function rateVideoRetryWrapper (req, res, next) { | 124 | function rateVideoRetryWrapper (req, res, next) { |
120 | const options = { | 125 | const options = { |
121 | arguments: [ req, res ], | 126 | arguments: [ req, res ], |
@@ -307,6 +312,7 @@ function addVideo (req, res, videoFile, finalCallback) { | |||
307 | remoteId: null, | 312 | remoteId: null, |
308 | extname: path.extname(videoFile.filename), | 313 | extname: path.extname(videoFile.filename), |
309 | category: videoInfos.category, | 314 | category: videoInfos.category, |
315 | licence: videoInfos.licence, | ||
310 | description: videoInfos.description, | 316 | description: videoInfos.description, |
311 | duration: videoFile.duration, | 317 | duration: videoFile.duration, |
312 | authorId: author.id | 318 | authorId: author.id |
@@ -421,6 +427,7 @@ function updateVideo (req, res, finalCallback) { | |||
421 | 427 | ||
422 | if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name) | 428 | if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name) |
423 | if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category) | 429 | if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category) |
430 | if (videoInfosToUpdate.licence) videoInstance.set('licence', videoInfosToUpdate.licence) | ||
424 | if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) | 431 | if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) |
425 | 432 | ||
426 | videoInstance.save(options).asCallback(function (err) { | 433 | videoInstance.save(options).asCallback(function (err) { |