aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-file.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-29 16:41:29 +0200
committerChocobozzz <me@florianbigard.com>2018-06-29 17:10:54 +0200
commit3a6f351b255d21ec42578632600ba699885f350e (patch)
treefdc770f5f59a87a929a5c85da9aed783e9676097 /server/models/video/video-file.ts
parent34b19192901b0f872c72ce8d94a69aeba51d1c29 (diff)
downloadPeerTube-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.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