aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/remote/videos.js2
-rw-r--r--server/controllers/api/videos.js7
2 files changed, 9 insertions, 0 deletions
diff --git a/server/controllers/api/remote/videos.js b/server/controllers/api/remote/videos.js
index ea1eeb146..e54793628 100644
--- a/server/controllers/api/remote/videos.js
+++ b/server/controllers/api/remote/videos.js
@@ -296,6 +296,7 @@ function addRemoteVideo (videoToCreateData, fromPod, finalCallback) {
296 infoHash: videoToCreateData.infoHash, 296 infoHash: videoToCreateData.infoHash,
297 category: videoToCreateData.category, 297 category: videoToCreateData.category,
298 licence: videoToCreateData.licence, 298 licence: videoToCreateData.licence,
299 language: videoToCreateData.language,
299 nsfw: videoToCreateData.nsfw, 300 nsfw: videoToCreateData.nsfw,
300 description: videoToCreateData.description, 301 description: videoToCreateData.description,
301 authorId: author.id, 302 authorId: author.id,
@@ -395,6 +396,7 @@ function updateRemoteVideo (videoAttributesToUpdate, fromPod, finalCallback) {
395 videoInstance.set('name', videoAttributesToUpdate.name) 396 videoInstance.set('name', videoAttributesToUpdate.name)
396 videoInstance.set('category', videoAttributesToUpdate.category) 397 videoInstance.set('category', videoAttributesToUpdate.category)
397 videoInstance.set('licence', videoAttributesToUpdate.licence) 398 videoInstance.set('licence', videoAttributesToUpdate.licence)
399 videoInstance.set('language', videoAttributesToUpdate.language)
398 videoInstance.set('nsfw', videoAttributesToUpdate.nsfw) 400 videoInstance.set('nsfw', videoAttributesToUpdate.nsfw)
399 videoInstance.set('description', videoAttributesToUpdate.description) 401 videoInstance.set('description', videoAttributesToUpdate.description)
400 videoInstance.set('infoHash', videoAttributesToUpdate.infoHash) 402 videoInstance.set('infoHash', videoAttributesToUpdate.infoHash)
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
48router.get('/categories', listVideoCategories) 48router.get('/categories', listVideoCategories)
49router.get('/licences', listVideoLicences) 49router.get('/licences', listVideoLicences)
50router.get('/languages', listVideoLanguages)
50 51
51router.get('/abuse', 52router.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
125function listVideoLanguages (req, res, next) {
126 res.json(constants.VIDEO_LANGUAGES)
127}
128
124function rateVideoRetryWrapper (req, res, next) { 129function 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