aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-29 16:21:32 +0200
committerChocobozzz <me@florianbigard.com>2021-06-29 16:21:32 +0200
commitc17ee0903ec33283351c206bc5fd7edc0af0fb12 (patch)
treea10558861bc087b8353e0d2b29b7e49b3a563054 /server/models/video/video.ts
parent0ca454e3bdf89390d1a48760ab555ddd8725c82d (diff)
downloadPeerTube-c17ee0903ec33283351c206bc5fd7edc0af0fb12.tar.gz
PeerTube-c17ee0903ec33283351c206bc5fd7edc0af0fb12.tar.zst
PeerTube-c17ee0903ec33283351c206bc5fd7edc0af0fb12.zip
Don't check enum for video model
Licence, language and category could be extended by a remote plugin
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts6
1 files changed, 0 insertions, 6 deletions
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'
43import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc' 43import { isActivityPubUrlValid } from '../../helpers/custom-validators/activitypub/misc'
44import { isBooleanValid } from '../../helpers/custom-validators/misc' 44import { isBooleanValid } from '../../helpers/custom-validators/misc'
45import { 45import {
46 isVideoCategoryValid,
47 isVideoDescriptionValid, 46 isVideoDescriptionValid,
48 isVideoDurationValid, 47 isVideoDurationValid,
49 isVideoLanguageValid,
50 isVideoLicenceValid,
51 isVideoNameValid, 48 isVideoNameValid,
52 isVideoPrivacyValid, 49 isVideoPrivacyValid,
53 isVideoStateValid, 50 isVideoStateValid,
@@ -458,19 +455,16 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
458 455
459 @AllowNull(true) 456 @AllowNull(true)
460 @Default(null) 457 @Default(null)
461 @Is('VideoCategory', value => throwIfNotValid(value, isVideoCategoryValid, 'category', true))
462 @Column 458 @Column
463 category: number 459 category: number
464 460
465 @AllowNull(true) 461 @AllowNull(true)
466 @Default(null) 462 @Default(null)
467 @Is('VideoLicence', value => throwIfNotValid(value, isVideoLicenceValid, 'licence', true))
468 @Column 463 @Column
469 licence: number 464 licence: number
470 465
471 @AllowNull(true) 466 @AllowNull(true)
472 @Default(null) 467 @Default(null)
473 @Is('VideoLanguage', value => throwIfNotValid(value, isVideoLanguageValid, 'language', true))
474 @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.LANGUAGE.max)) 468 @Column(DataType.STRING(CONSTRAINTS_FIELDS.VIDEOS.LANGUAGE.max))
475 language: string 469 language: string
476 470