]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-file.ts
Fix refreshing external video attributes
[github/Chocobozzz/PeerTube.git] / server / models / video / video-file.ts
index 0907ea569fa3f0f3a21c34056842d0ef924d9174..f040803b9a0240d2156df0dc073e0609f237b3fe 100644 (file)
@@ -66,8 +66,8 @@ export class VideoFileModel extends Model<VideoFileModel> {
   @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<VideoFileModel> {
                 return results.length === 1
               })
   }
+
+  hasSameUniqueKeysThan (other: VideoFileModel) {
+    return this.fps === other.fps &&
+      this.resolution === other.resolution &&
+      this.videoId === other.videoId
+  }
 }