Improve game overview

- add counts for each section
- add average hours per session
This commit is contained in:
2023-10-09 00:00:45 +02:00
parent 9a332593f4
commit 11b9c602de
6 changed files with 70 additions and 173 deletions

View File

@ -36,9 +36,9 @@ def format_duration(
minute_seconds = 60
hour_seconds = 60 * minute_seconds
day_seconds = 24 * hour_seconds
duration = _safe_timedelta(duration)
safe_duration = _safe_timedelta(duration)
# we don't need float
seconds_total = int(duration.total_seconds())
seconds_total = int(safe_duration.total_seconds())
# timestamps where end is before start
if seconds_total < 0:
seconds_total = 0