diff options
Diffstat (limited to 'server/models/video/video-file.ts')
-rw-r--r-- | server/models/video/video-file.ts | 15 |
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 @@ | |||
1 | import { values } from 'lodash' | 1 | import { values } from 'lodash' |
2 | import { AllowNull, BelongsTo, Column, CreatedAt, DataType, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' | 2 | import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Is, Model, Table, UpdatedAt } from 'sequelize-typescript' |
3 | import { isVideoFileInfoHashValid, isVideoFileResolutionValid, isVideoFileSizeValid } from '../../helpers/custom-validators/videos' | 3 | import { |
4 | isVideoFileInfoHashValid, | ||
5 | isVideoFileResolutionValid, | ||
6 | isVideoFileSizeValid, | ||
7 | isVideoFPSResolutionValid | ||
8 | } from '../../helpers/custom-validators/videos' | ||
4 | import { CONSTRAINTS_FIELDS } from '../../initializers' | 9 | import { CONSTRAINTS_FIELDS } from '../../initializers' |
5 | import { throwIfNotValid } from '../utils' | 10 | import { throwIfNotValid } from '../utils' |
6 | import { VideoModel } from './video' | 11 | import { 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 |