diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-29 16:41:29 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-29 17:10:54 +0200 |
commit | 3a6f351b255d21ec42578632600ba699885f350e (patch) | |
tree | fdc770f5f59a87a929a5c85da9aed783e9676097 /server/models/video/video-file.ts | |
parent | 34b19192901b0f872c72ce8d94a69aeba51d1c29 (diff) | |
download | PeerTube-3a6f351b255d21ec42578632600ba699885f350e.tar.gz PeerTube-3a6f351b255d21ec42578632600ba699885f350e.tar.zst PeerTube-3a6f351b255d21ec42578632600ba699885f350e.zip |
Handle higher FPS for high resolution (test)
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 |