[bugfix]: deal with broken jellyfin

This commit is contained in:
Kendall Garner 2024-04-09 22:49:44 -07:00
parent c3fcb7487c
commit f79f9cc79e
No known key found for this signature in database
GPG Key ID: 18D2767419676C87

View File

@ -1,8 +1,8 @@
const SIZES = ['B', 'KiB', 'MiB', 'GiB', 'TiB'];
export const formatSizeString = (size: number): string => {
export const formatSizeString = (size?: number): string => {
let count = 0;
let finalSize = size;
let finalSize = size ?? 0;
while (finalSize > 1024) {
finalSize /= 1024;
count += 1;