aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-09-09 09:21:42 +0200
committerChocobozzz <me@florianbigard.com>2022-09-09 09:21:42 +0200
commite4fc3697acb27c4192cbbb63eb94272a6cf7ce32 (patch)
tree96daedbbbc030920bae25816dd15a16a8c85fb8f /server/models
parent405c83f9af377a663a4c8e9ad025fd5c10496922 (diff)
downloadPeerTube-e4fc3697acb27c4192cbbb63eb94272a6cf7ce32.tar.gz
PeerTube-e4fc3697acb27c4192cbbb63eb94272a6cf7ce32.tar.zst
PeerTube-e4fc3697acb27c4192cbbb63eb94272a6cf7ce32.zip
Fix saved live master playlist bandwidth
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video.ts2
1 files changed, 2 insertions, 0 deletions
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<Partial<AttributesOnly<VideoModel>>> {
1899 } 1899 }
1900 1900
1901 getBandwidthBits (this: MVideo, videoFile: MVideoFile) { 1901 getBandwidthBits (this: MVideo, videoFile: MVideoFile) {
1902 if (!this.duration) throw new Error(`Cannot get bandwidth bits because video ${this.url} has duration of 0`)
1903
1902 return Math.ceil((videoFile.size * 8) / this.duration) 1904 return Math.ceil((videoFile.size * 8) / this.duration)
1903 } 1905 }
1904 1906