aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-03-28 21:19:46 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-03-28 21:19:46 +0200
commit31b59b477459d4f26ed8ef089a0e5553fb6a332b (patch)
tree70de15dc172045d01ad45718f55c22d5ca43b354 /server/controllers/api
parentd07137b90b2b2b0c1e93a6f0e7bf8719b133027c (diff)
downloadPeerTube-31b59b477459d4f26ed8ef089a0e5553fb6a332b.tar.gz
PeerTube-31b59b477459d4f26ed8ef089a0e5553fb6a332b.tar.zst
PeerTube-31b59b477459d4f26ed8ef089a0e5553fb6a332b.zip
Server: add nsfw attribute
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/remote/videos.js2
-rw-r--r--server/controllers/api/videos.js2
2 files changed, 4 insertions, 0 deletions
diff --git a/server/controllers/api/remote/videos.js b/server/controllers/api/remote/videos.js
index a3e1189c7..ea1eeb146 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 nsfw: videoToCreateData.nsfw,
299 description: videoToCreateData.description, 300 description: videoToCreateData.description,
300 authorId: author.id, 301 authorId: author.id,
301 duration: videoToCreateData.duration, 302 duration: videoToCreateData.duration,
@@ -394,6 +395,7 @@ function updateRemoteVideo (videoAttributesToUpdate, fromPod, finalCallback) {
394 videoInstance.set('name', videoAttributesToUpdate.name) 395 videoInstance.set('name', videoAttributesToUpdate.name)
395 videoInstance.set('category', videoAttributesToUpdate.category) 396 videoInstance.set('category', videoAttributesToUpdate.category)
396 videoInstance.set('licence', videoAttributesToUpdate.licence) 397 videoInstance.set('licence', videoAttributesToUpdate.licence)
398 videoInstance.set('nsfw', videoAttributesToUpdate.nsfw)
397 videoInstance.set('description', videoAttributesToUpdate.description) 399 videoInstance.set('description', videoAttributesToUpdate.description)
398 videoInstance.set('infoHash', videoAttributesToUpdate.infoHash) 400 videoInstance.set('infoHash', videoAttributesToUpdate.infoHash)
399 videoInstance.set('duration', videoAttributesToUpdate.duration) 401 videoInstance.set('duration', videoAttributesToUpdate.duration)
diff --git a/server/controllers/api/videos.js b/server/controllers/api/videos.js
index 375e89387..3d616e33d 100644
--- a/server/controllers/api/videos.js
+++ b/server/controllers/api/videos.js
@@ -313,6 +313,7 @@ function addVideo (req, res, videoFile, finalCallback) {
313 extname: path.extname(videoFile.filename), 313 extname: path.extname(videoFile.filename),
314 category: videoInfos.category, 314 category: videoInfos.category,
315 licence: videoInfos.licence, 315 licence: videoInfos.licence,
316 nsfw: videoInfos.nsfw,
316 description: videoInfos.description, 317 description: videoInfos.description,
317 duration: videoFile.duration, 318 duration: videoFile.duration,
318 authorId: author.id 319 authorId: author.id
@@ -428,6 +429,7 @@ function updateVideo (req, res, finalCallback) {
428 if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name) 429 if (videoInfosToUpdate.name) videoInstance.set('name', videoInfosToUpdate.name)
429 if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category) 430 if (videoInfosToUpdate.category) videoInstance.set('category', videoInfosToUpdate.category)
430 if (videoInfosToUpdate.licence) videoInstance.set('licence', videoInfosToUpdate.licence) 431 if (videoInfosToUpdate.licence) videoInstance.set('licence', videoInfosToUpdate.licence)
432 if (videoInfosToUpdate.nsfw) videoInstance.set('nsfw', videoInfosToUpdate.nsfw)
431 if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) 433 if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description)
432 434
433 videoInstance.save(options).asCallback(function (err) { 435 videoInstance.save(options).asCallback(function (err) {