1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-06 03:50:26 +02:00

Add video privacy setting

This commit is contained in:
Chocobozzz 2017-10-31 11:52:52 +01:00
parent b7a485121d
commit fd45e8f43c
No known key found for this signature in database
GPG key ID: 583A612D890159BE
48 changed files with 545 additions and 208 deletions

View file

@ -11,6 +11,7 @@ import {
VIDEO_LICENCES,
VIDEO_LANGUAGES,
VIDEO_RATE_TYPES,
VIDEO_PRIVACIES,
database as db
} from '../../initializers'
import { isUserUsernameValid } from './users'
@ -36,6 +37,15 @@ function isVideoLicenceValid (value: number) {
return VIDEO_LICENCES[value] !== undefined
}
function isVideoPrivacyValid (value: string) {
return VIDEO_PRIVACIES[value] !== undefined
}
// Maybe we don't know the remote privacy setting, but that doesn't matter
function isRemoteVideoPrivacyValid (value: string) {
return validator.isInt('' + value)
}
// Maybe we don't know the remote licence, but that doesn't matter
function isRemoteVideoLicenceValid (value: string) {
return validator.isInt('' + value)
@ -195,6 +205,8 @@ export {
isVideoDislikesValid,
isVideoEventCountValid,
isVideoFileSizeValid,
isVideoPrivacyValid,
isRemoteVideoPrivacyValid,
isVideoFileResolutionValid,
checkVideoExists,
isRemoteVideoCategoryValid,