1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 10:49:28 +02:00

Server: add nsfw attribute

This commit is contained in:
Chocobozzz 2017-03-28 21:19:46 +02:00
parent d07137b90b
commit 31b59b4774
14 changed files with 154 additions and 2 deletions

View file

@ -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)

View file

@ -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) {