Browse Source

Fix comma if only hours

Colin Powell 2 năm trước cách đây
mục cha
commit
aefdc507d8
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  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