From aefdc507d81a5b751ccfa7f08eb9c8dd2b075c28 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Wed, 8 Mar 2023 12:47:29 -0500 Subject: [PATCH] Fix comma if only hours --- vrobbler/apps/videogames/templatetags/naturalduration.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vrobbler/apps/videogames/templatetags/naturalduration.py b/vrobbler/apps/videogames/templatetags/naturalduration.py index 806faa5..d34bbe7 100644 --- a/vrobbler/apps/videogames/templatetags/naturalduration.py +++ b/vrobbler/apps/videogames/templatetags/naturalduration.py @@ -15,5 +15,7 @@ def natural_duration(value): if minutes: value_str = f"{minutes} minutes" if hours: + if not value_str: + return f"{hours} hours" value_str = f"{hours} hours, " + value_str return value_str