Support seconds in formatted playtime

This commit is contained in:
Mathieu Comandon 2019-01-22 00:04:09 -08:00
parent 68d7fade47
commit 0c29b11427

View file

@ -124,4 +124,10 @@ def get_formatted_playtime(playtime):
else:
minutes_text = ""
return " and ".join([text for text in (hours_text, minutes_text) if text]) or "0 minute"
formatted_time = " and ".join([text for text in (hours_text, minutes_text) if text])
if formatted_time:
return formatted_time
seconds = int(hours * 3600)
if seconds:
return "%d seconds" % seconds
return "No play time recorded"