From e4fc3697acb27c4192cbbb63eb94272a6cf7ce32 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 9 Sep 2022 09:21:42 +0200 Subject: Fix saved live master playlist bandwidth --- server/models/video/video.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'server/models/video') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index a8ea67c39..468117504 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1899,6 +1899,8 @@ export class VideoModel extends Model>> { } getBandwidthBits (this: MVideo, videoFile: MVideoFile) { + if (!this.duration) throw new Error(`Cannot get bandwidth bits because video ${this.url} has duration of 0`) + return Math.ceil((videoFile.size * 8) / this.duration) } -- cgit v1.2.3