diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-04-07 12:13:37 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-04-07 12:13:37 +0200 |
commit | 3092476e64d09b449b4ad4f5198024afec1b22ca (patch) | |
tree | f2d2bd33578e122188cd2297f60e12813bffdbb7 /server/controllers/api/videos.js | |
parent | 023553a2bde74c5765b5ea679fc04128c27f18a0 (diff) | |
download | PeerTube-3092476e64d09b449b4ad4f5198024afec1b22ca.tar.gz PeerTube-3092476e64d09b449b4ad4f5198024afec1b22ca.tar.zst PeerTube-3092476e64d09b449b4ad4f5198024afec1b22ca.zip |
Server: add video language attribute
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 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 | |||
47 | 47 | ||
48 | router.get('/categories', listVideoCategories) | 48 | router.get('/categories', listVideoCategories) |
49 | router.get('/licences', listVideoLicences) | 49 | router.get('/licences', listVideoLicences) |
50 | router.get('/languages', listVideoLanguages) | ||
50 | 51 | ||
51 | router.get('/abuse', | 52 | router.get('/abuse', |
52 | oAuth.authenticate, | 53 | oAuth.authenticate, |
@@ -121,6 +122,10 @@ function listVideoLicences (req, res, next) { | |||
121 | res.json(constants.VIDEO_LICENCES) | 122 | res.json(constants.VIDEO_LICENCES) |
122 | } | 123 | } |
123 | 124 | ||
125 | function listVideoLanguages (req, res, next) { | ||
126 | res.json(constants.VIDEO_LANGUAGES) | ||
127 | } | ||
128 | |||
124 | function rateVideoRetryWrapper (req, res, next) { | 129 | function rateVideoRetryWrapper (req, res, next) { |
125 | const options = { | 130 | const options = { |
126 | arguments: [ req, res ], | 131 | arguments: [ req, res ], |
@@ -313,6 +318,7 @@ function addVideo (req, res, videoFile, finalCallback) { | |||
313 | extname: path.extname(videoFile.filename), | 318 | extname: path.extname(videoFile.filename), |
314 | category: videoInfos.category, | 319 | category: videoInfos.category, |
315 | licence: videoInfos.licence, | 320 | licence: videoInfos.licence, |
321 | language: videoInfos.language, | ||
316 | nsfw: videoInfos.nsfw, | 322 | nsfw: videoInfos.nsfw, |
317 | description: videoInfos.description, | 323 | description: videoInfos.description, |
318 | duration: videoFile.duration, | 324 | duration: videoFile.duration, |
@@ -429,6 +435,7 @@ function updateVideo (req, res, finalCallback) { | |||
429 | if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name) | 435 | if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name) |
430 | if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category) | 436 | if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category) |
431 | if (videoInfosToUpdate.licence) videoInstance.set('licence', videoInfosToUpdate.licence) | 437 | if (videoInfosToUpdate.licence) videoInstance.set('licence', videoInfosToUpdate.licence) |
438 | if (videoInfosToUpdate.language) videoInstance.set('language', videoInfosToUpdate.language) | ||
432 | if (videoInfosToUpdate.nsfw) videoInstance.set('nsfw', videoInfosToUpdate.nsfw) | 439 | if (videoInfosToUpdate.nsfw) videoInstance.set('nsfw', videoInfosToUpdate.nsfw) |
433 | if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) | 440 | if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) |
434 | 441 | ||