Coverage for opt/mealie/lib/python3.12/site-packages/mealie/schema/group/group_statistics.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-11-25 15:48 +0000

1from mealie.pkgs.stats import fs_stats 1a

2from mealie.schema._mealie import MealieModel 1a

3 

4 

5class GroupStorage(MealieModel): 1a

6 used_storage_bytes: int 1a

7 used_storage_str: str 1a

8 total_storage_bytes: int 1a

9 total_storage_str: str 1a

10 

11 @classmethod 1a

12 def bytes(cls, used_storage_bytes: int, total_storage_bytes: int) -> "GroupStorage": 1a

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 )