Add current background maxsize #1501

This commit is contained in:
Chris Hunt
2025-09-15 16:26:10 +01:00
parent c9ea2cdeb3
commit 31f1ba8192
2 changed files with 23 additions and 1 deletions

View File

@@ -27,6 +27,17 @@ function format_bytes($bytes, bool $is_drive_size = true, string $beforeunit = '
}
}
function parse_size($size) {
$unit = strtolower(substr($size, -1));
$bytes = (int)$size;
switch($unit) {
case 'g': $bytes *= 1024 * 1024 * 1024; break;
case 'm': $bytes *= 1024 * 1024; break;
case 'k': $bytes *= 1024; break;
}
return $bytes;
}
/**
* @param $title
* @param string $separator