diff --git a/vrobbler/apps/videogames/templatetags/naturalduration.py b/vrobbler/apps/videogames/templatetags/naturalduration.py index d34bbe7..075a2a2 100644 --- a/vrobbler/apps/videogames/templatetags/naturalduration.py +++ b/vrobbler/apps/videogames/templatetags/naturalduration.py @@ -11,11 +11,18 @@ def natural_duration(value): total_minutes = int(value / 60) hours = int(total_minutes / 60) minutes = total_minutes - (hours * 60) + seconds = value % 60 value_str = "" + if seconds: + value_str = f"{seconds} seconds" if minutes: - value_str = f"{minutes} minutes" + if value_str: + value_str = f"{minutes} minutes, " + value_str + else: + value_str = f"{minutes} minutes" if hours: - if not value_str: - return f"{hours} hours" - value_str = f"{hours} hours, " + value_str + if value_str: + value_str = f"{hours} hours, " + value_str + else: + value_str = f"{hours} hours" return value_str diff --git a/vrobbler/templates/_scrobblable_list.html b/vrobbler/templates/_scrobblable_list.html index f30223f..2945d67 100644 --- a/vrobbler/templates/_scrobblable_list.html +++ b/vrobbler/templates/_scrobblable_list.html @@ -12,6 +12,9 @@ {% if object_list.0.domain %}
| Scrobbles | -Title | -Point | -
|---|
{{scrobble.media_obj|truncatechars_html:45}} - {{scrobble.logdata.movement_type}}> {% else %} - {{scrobble.media_obj|truncatechars_html:45}} +
{{scrobble.media_obj|truncatechars_html:45}}> {% endif %}