fix: parse size strings using bytes library for accurate size conversion

This commit is contained in:
Viren070
2025-10-25 16:13:51 +01:00
parent 4a25c1aee1
commit 108099b30d
+2 -1
View File
@@ -1,3 +1,4 @@
import bytes from 'bytes';
import { Stream, ParsedStream, Addon, ParsedFile } from '../db/index.js';
import {
constants,
@@ -267,7 +268,7 @@ class StreamParser {
(stream.name && this.calculateBytesFromSizeString(stream.name));
if (typeof size === 'string') {
size = parseInt(size);
size = bytes.parse(size);
} else if (typeof size === 'number') {
size = Math.round(size);
}