mirror of
https://github.com/immich-app/immich.git
synced 2024-12-23 02:06:15 +02:00
25e68cf826
* Use custom caches in all modules * Cache Settings * Fix wrong key * Create custom cache repository based on hive * Show cache usage in settings * Show cache sizes * Change settings ranges and default value * Handle cache clear by operating system * Resolve review comments
15 lines
383 B
Dart
15 lines
383 B
Dart
|
|
String formatBytes(int bytes) {
|
|
if (bytes < 1000) {
|
|
return "$bytes B";
|
|
} else if (bytes < 1000000) {
|
|
final kb = (bytes / 1000).toStringAsFixed(1);
|
|
return "$kb kB";
|
|
} else if (bytes < 1000000000) {
|
|
final mb = (bytes / 1000000).toStringAsFixed(1);
|
|
return "$mb MB";
|
|
} else {
|
|
final gb = (bytes / 1000000000).toStringAsFixed(1);
|
|
return "$gb GB";
|
|
}
|
|
} |