Don't check enum for video model

Licence, language and category could be extended by a remote plugin
pull/4218/head
Chocobozzz 2021-06-29 16:21:32 +02:00
parent 0ca454e3bd
commit c17ee0903e
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 0 additions and 6 deletions

View File

@ -43,11 +43,8 @@ import { peertubeTruncate } from '../../helpers/core-utils'
import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
import { isBooleanValid } from '../../helpers/custom-validators/misc'
import {
isVideoCategoryValid,
isVideoDescriptionValid,
isVideoDurationValid,
isVideoLanguageValid,
isVideoLicenceValid,
isVideoNameValid,
isVideoPrivacyValid,
isVideoStateValid,
@ -458,19 +455,16 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
@AllowNull(true)
@Default(null)
@Is('VideoCategory', value => throwIfNotValid(value, isVideoCategoryValid, 'category', true))
@Column
category: number
@AllowNull(true)
@Default(null)
@Is('VideoLicence', value => throwIfNotValid(value, isVideoLicenceValid, 'licence', true))
@Column
licence: number
@AllowNull(true)
@Default(null)
@Is('VideoLanguage', value => throwIfNotValid(value, isVideoLanguageValid, 'language', true))
@Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.LANGUAGE.max))
language: string