From 31b59b477459d4f26ed8ef089a0e5553fb6a332b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 Mar 2017 21:19:46 +0200 Subject: Server: add nsfw attribute --- server/controllers/api/remote/videos.js | 2 ++ server/controllers/api/videos.js | 2 ++ 2 files changed, 4 insertions(+) (limited to 'server/controllers/api') 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) { infoHash: videoToCreateData.infoHash, category: videoToCreateData.category, licence: videoToCreateData.licence, + nsfw: videoToCreateData.nsfw, description: videoToCreateData.description, authorId: author.id, duration: videoToCreateData.duration, @@ -394,6 +395,7 @@ function updateRemoteVideo (videoAttributesToUpdate, fromPod, finalCallback) { videoInstance.set('name', videoAttributesToUpdate.name) videoInstance.set('category', videoAttributesToUpdate.category) videoInstance.set('licence', videoAttributesToUpdate.licence) + videoInstance.set('nsfw', videoAttributesToUpdate.nsfw) videoInstance.set('description', videoAttributesToUpdate.description) videoInstance.set('infoHash', videoAttributesToUpdate.infoHash) 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) { extname: path.extname(videoFile.filename), category: videoInfos.category, licence: videoInfos.licence, + nsfw: videoInfos.nsfw, description: videoInfos.description, duration: videoFile.duration, authorId: author.id @@ -428,6 +429,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.nsfw) videoInstance.set('nsfw', videoInfosToUpdate.nsfw) if (videoInfosToUpdate.description) videoInstance.set('description', videoInfosToUpdate.description) videoInstance.save(options).asCallback(function (err) { -- cgit v1.2.3