Fixed download sizes and directory highlighting

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
sarahandClaude Opus 5.5 committed 2026-10-13 14:46:47 +02:00
1 parent 843ad1986e
commit d4c018a402
8 files changed
+113 -37

No files matched your search

+11
View File
@@ -539,6 +539,17 @@ def HumanSize(NumBytes: Optional[int]) -> str:
return f"{Size:.1f} TB"
def HumanDuration(Seconds: float) -> str:
"""Roughly, for "about ... left": 8 s, 3 min, 1 h, 1 h 20 min."""
Seconds = max(1, round(Seconds))
if Seconds < 60:
return f"{Seconds} s"
Hours, Minutes = divmod(round(Seconds / 60), 60)
if not Hours:
return f"{Minutes} min"
return f"{Hours} h {Minutes} min" if Minutes else f"{Hours} h"
def DisplayPath(PathText: str) -> str:
"""/home/sarah/Notes -> ~/Notes, for labels (C:\\Users\\x\\Notes -> ~\\Notes)."""
HomeText = str(Home)