From: Chocobozzz Date: Tue, 29 Jun 2021 14:21:32 +0000 (+0200) Subject: Don't check enum for video model X-Git-Tag: v3.3.0-rc.1~31 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=c17ee0903ec33283351c206bc5fd7edc0af0fb12;p=github%2FChocobozzz%2FPeerTube.git Don't check enum for video model Licence, language and category could be extended by a remote plugin --- diff --git a/server/models/video/video.ts b/server/models/video/video.ts index d2efc2553..2b40225dd 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -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>> { @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