Coverage for opt/mealie/lib/python3.12/site-packages/mealie/schema/group/group_statistics.py: 100%
10 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 03:04 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 03:04 +0000
1from mealie.pkgs.stats import fs_stats
2from mealie.schema._mealie import MealieModel
5class GroupStorage(MealieModel):
6 used_storage_bytes: int
7 used_storage_str: str
8 total_storage_bytes: int
9 total_storage_str: str
11 @classmethod
12 def bytes(cls, used_storage_bytes: int, total_storage_bytes: int) -> "GroupStorage":
13 return cls(
14 used_storage_bytes=used_storage_bytes,
15 used_storage_str=fs_stats.pretty_size(used_storage_bytes),
16 total_storage_bytes=total_storage_bytes,
17 total_storage_str=fs_stats.pretty_size(total_storage_bytes),
18 )