aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video-file.ts')
-rw-r--r--server/models/video/video-file.ts15
1 files changed, 13 insertions, 2 deletions
diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts
index df4067a4e..372d18d69 100644
--- a/server/models/video/video-file.ts
+++ b/server/models/video/video-file.ts
@@ -1,6 +1,11 @@
1import { values } from 'lodash' 1import { values } from 'lodash'
2import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' 2import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript'
3import { isVideoFileInfoHashValid, isVideoFileResolutionValid, isVideoFileSizeValid } from '../../helpers/custom-validators/videos' 3import {
4 isVideoFileInfoHashValid,
5 isVideoFileResolutionValid,
6 isVideoFileSizeValid,
7 isVideoFPSResolutionValid
8} from '../../helpers/custom-validators/videos'
4import { CONSTRAINTS_FIELDS } from '../../initializers' 9import { CONSTRAINTS_FIELDS } from '../../initializers'
5import { throwIfNotValid } from '../utils' 10import { throwIfNotValid } from '../utils'
6import { VideoModel } from './video' 11import { VideoModel } from './video'
@@ -42,6 +47,12 @@ export class VideoFileModel extends Model<VideoFileModel> {
42 @Column 47 @Column
43 infoHash: string 48 infoHash: string
44 49
50 @AllowNull(true)
51 @Default(null)
52 @Is('VideoFileFPS', value => throwIfNotValid(value, isVideoFPSResolutionValid, 'fps'))
53 @Column
54 fps: number
55
45 @ForeignKey(() => VideoModel) 56 @ForeignKey(() => VideoModel)
46 @Column 57 @Column
47 videoId: number 58 videoId: number