From 3092476e64d09b449b4ad4f5198024afec1b22ca Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 7 Apr 2017 12:13:37 +0200 Subject: Server: add video language attribute --- server/controllers/api/videos.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'server/controllers/api/videos.js') diff --git a/server/controllers/api/videos.js b/server/controllers/api/videos.js index 3d616e33d..5e9ff482f 100644 --- a/server/controllers/api/videos.js +++ b/server/controllers/api/videos.js @@ -47,6 +47,7 @@ const reqFiles = multer({ storage: storage }).fields([{ name: 'videofile', maxCo router.get('/categories', listVideoCategories) router.get('/licences', listVideoLicences) +router.get('/languages', listVideoLanguages) router.get('/abuse', oAuth.authenticate, @@ -121,6 +122,10 @@ function listVideoLicences (req, res, next) { res.json(constants.VIDEO_LICENCES) } +function listVideoLanguages (req, res, next) { + res.json(constants.VIDEO_LANGUAGES) +} + function rateVideoRetryWrapper (req, res, next) { const options = { arguments: [ req, res ], @@ -313,6 +318,7 @@ function addVideo (req, res, videoFile, finalCallback) { extname: path.extname(videoFile.filename), category: videoInfos.category, licence: videoInfos.licence, + language: videoInfos.language, nsfw: videoInfos.nsfw, description: videoInfos.description, duration: videoFile.duration, @@ -429,6 +435,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.language) videoInstance.set('language', videoInfosToUpdate.language) if (videoInfosToUpdate.nsfw) videoInstance.set('nsfw', videoInfosToUpdate.nsfw) if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) -- cgit v1.2.3