fix output time string conversion

This commit is contained in:
2026-08-07 16:24:46 +02:00
parent c9904b20a9
commit afdab6e864
+3 -3
View File
@@ -636,15 +636,15 @@ def format_seconds(seconds: int | float | None) -> str:
return f"{hours:02d}:{minutes:02d}:{sec:02d}"
def format_hours(hours: float | None) -> str:
"""Return string representation in format hours:seconds"""
"""Return string representation in format hours:minutes:seconds."""
if hours is None:
return "Unknown"
td = timedelta(hours)
td = timedelta(hours=hours)
sraw = int(td.total_seconds())
hr = sraw // 3600
mn = (sraw % 3600) // 60
sc = sraw % 60
return f"{hr}:{round(mn,0)}:{sc}"
return f"{hr}:{round(mn,0):02d}:{sc:02d}"
def parse_size_to_bytes(value: str) -> int | None: