Explorar o código

Fix comma if only hours

Colin Powell %!s(int64=2) %!d(string=hai) anos
pai
achega
aefdc507d8
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      vrobbler/apps/videogames/templatetags/naturalduration.py

+ 2 - 0
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