aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r--server/models/video/video.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 06aec1308..3a0d95b62 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -2016,7 +2016,7 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> {
2016 } 2016 }
2017 2017
2018 getBandwidthBits (this: MVideo, videoFile: MVideoFile) { 2018 getBandwidthBits (this: MVideo, videoFile: MVideoFile) {
2019 if (!this.duration) throw new Error(`Cannot get bandwidth bits because video ${this.url} has duration of 0`) 2019 if (!this.duration) return videoFile.size
2020 2020
2021 return Math.ceil((videoFile.size * 8) / this.duration) 2021 return Math.ceil((videoFile.size * 8) / this.duration)
2022 } 2022 }