aboutsummaryrefslogtreecommitdiff
path: root/src/utils/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/__init__.py')
-rw-r--r--src/utils/__init__.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/utils/__init__.py b/src/utils/__init__.py
index d76f020f..c9a42935 100644
--- a/src/utils/__init__.py
+++ b/src/utils/__init__.py
@@ -62,6 +62,9 @@ UNIT_DAY = 2
UNIT_WEEK = 1
def to_pretty_time(total_seconds: int, minimum_unit: int=UNIT_SECOND,
max_units: int=UNIT_MINIMUM) -> str:
+ if total_seconds == 0:
+ return "0s"
+
minutes, seconds = divmod(total_seconds, 60)
hours, minutes = divmod(minutes, 60)
days, hours = divmod(hours, 24)