mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Server: add nsfw attribute
This commit is contained in:
parent
d07137b90b
commit
31b59b4774
14 changed files with 154 additions and 2 deletions
|
@ -87,6 +87,7 @@ function isCommonVideoAttributesValid (video) {
|
|||
videosValidators.isVideoDateValid(video.updatedAt) &&
|
||||
videosValidators.isVideoCategoryValid(video.category) &&
|
||||
videosValidators.isVideoLicenceValid(video.licence) &&
|
||||
videosValidators.isVideoNSFWValid(video.nsfw) &&
|
||||
videosValidators.isVideoDescriptionValid(video.description) &&
|
||||
videosValidators.isVideoDurationValid(video.duration) &&
|
||||
videosValidators.isVideoInfoHashValid(video.infoHash) &&
|
||||
|
|
|
@ -15,6 +15,7 @@ const videosValidators = {
|
|||
isVideoDateValid,
|
||||
isVideoCategoryValid,
|
||||
isVideoLicenceValid,
|
||||
isVideoNSFWValid,
|
||||
isVideoDescriptionValid,
|
||||
isVideoDurationValid,
|
||||
isVideoInfoHashValid,
|
||||
|
@ -50,6 +51,10 @@ function isVideoLicenceValid (value) {
|
|||
return constants.VIDEO_LICENCES[value] !== undefined
|
||||
}
|
||||
|
||||
function isVideoNSFWValid (value) {
|
||||
return validator.isBoolean(value)
|
||||
}
|
||||
|
||||
function isVideoDescriptionValid (value) {
|
||||
return validator.isLength(value, VIDEOS_CONSTRAINTS_FIELDS.DESCRIPTION)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue