mirror of https://github.com/Chocobozzz/PeerTube
Don't check enum for video model
Licence, language and category could be extended by a remote pluginpull/4218/head
parent
0ca454e3bd
commit
c17ee0903e
|
@ -43,11 +43,8 @@ import { peertubeTruncate } from '../../helpers/core-utils'
|
||||||
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
|
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
|
||||||
import { isBooleanValid } from '../../helpers/custom-validators/misc'
|
import { isBooleanValid } from '../../helpers/custom-validators/misc'
|
||||||
import {
|
import {
|
||||||
isVideoCategoryValid,
|
|
||||||
isVideoDescriptionValid,
|
isVideoDescriptionValid,
|
||||||
isVideoDurationValid,
|
isVideoDurationValid,
|
||||||
isVideoLanguageValid,
|
|
||||||
isVideoLicenceValid,
|
|
||||||
isVideoNameValid,
|
isVideoNameValid,
|
||||||
isVideoPrivacyValid,
|
isVideoPrivacyValid,
|
||||||
isVideoStateValid,
|
isVideoStateValid,
|
||||||
|
@ -458,19 +455,16 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
|
||||||
|
|
||||||
@AllowNull(true)
|
@AllowNull(true)
|
||||||
@Default(null)
|
@Default(null)
|
||||||
@Is('VideoCategory', value => throwIfNotValid(value, isVideoCategoryValid, 'category', true))
|
|
||||||
@Column
|
@Column
|
||||||
category: number
|
category: number
|
||||||
|
|
||||||
@AllowNull(true)
|
@AllowNull(true)
|
||||||
@Default(null)
|
@Default(null)
|
||||||
@Is('VideoLicence', value => throwIfNotValid(value, isVideoLicenceValid, 'licence', true))
|
|
||||||
@Column
|
@Column
|
||||||
licence: number
|
licence: number
|
||||||
|
|
||||||
@AllowNull(true)
|
@AllowNull(true)
|
||||||
@Default(null)
|
@Default(null)
|
||||||
@Is('VideoLanguage', value => throwIfNotValid(value, isVideoLanguageValid, 'language', true))
|
|
||||||
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.LANGUAGE.max))
|
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.LANGUAGE.max))
|
||||||
language: string
|
language: string
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue