diff options
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 2 |
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 | ||