Commit 18e49cfa authored by fred's avatar fred
Browse files

dispaly duration of soundfiles

parent defed61b
......@@ -100,3 +100,10 @@ def can_focus(object):
elif isinstance(object, SoundFile):
return True
return False
def as_duration(value):
if not value:
return '-'
return '%s:%02d' % (value/60, value%60)
......@@ -74,6 +74,7 @@ Tags :
......@@ -86,6 +87,7 @@ Tags :
<td><a href="{{ soundfile.file.url }}">{{ soundfile|sound_filename }}</a></td>
<td>{{ soundfile.title }}</td>
<td>{{ soundfile.duration|as_duration }}</td>
<td>{% if soundfile.format %}{{ soundfile.format }}{% else %}-{% endif %}</td>
<td>{% if soundfile.podcastable %}oui{% else %}non{% endif %}</td>
<td>{% if soundfile.fragment %}oui{% else %}non{% endif %}</td>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment