Explorar el Código

Fix comma if only hours

Colin Powell hace 2 años
padre
commit
aefdc507d8
Se han modificado 1 ficheros con 2 adiciones y 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