X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmodels%2Fvideo%2Fvideo-file.ts;h=f040803b9a0240d2156df0dc073e0609f237b3fe;hb=d382f4e9175c1520835e41c3573471a84bcf1713;hp=0907ea569fa3f0f3a21c34056842d0ef924d9174;hpb=c48e82b5e0478434de30626d14594a97f2402e7c;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/models/video/video-file.ts b/server/models/video/video-file.ts index 0907ea569..f040803b9 100644 --- a/server/models/video/video-file.ts +++ b/server/models/video/video-file.ts @@ -66,8 +66,8 @@ export class VideoFileModel extends Model { @Column infoHash: string - @AllowNull(true) - @Default(null) + @AllowNull(false) + @Default(-1) @Is('VideoFileFPS', value => throwIfNotValid(value, isVideoFPSResolutionValid, 'fps')) @Column fps: number @@ -106,4 +106,10 @@ export class VideoFileModel extends Model { return results.length === 1 }) } + + hasSameUniqueKeysThan (other: VideoFileModel) { + return this.fps === other.fps && + this.resolution === other.resolution && + this.videoId === other.videoId + } }