From: Radek Czajka Date: Wed, 28 Jul 2021 12:41:29 +0000 (+0200) Subject: Minor fix for duration tag. X-Git-Url: https://git.mdrn.pl/audio.git/commitdiff_plain/6c47ac514a79923b1f1701874624d383f398ed16?ds=sidebyside;hp=c890962d08c585b0534c631aaa87f0eb7ea7d3a1 Minor fix for duration tag. --- diff --git a/src/archive/templatetags/tags.py b/src/archive/templatetags/tags.py index 2acc8b1..0fa23ac 100755 --- a/src/archive/templatetags/tags.py +++ b/src/archive/templatetags/tags.py @@ -39,7 +39,10 @@ def status(audiobook, format): @register.filter def duration(s): - h = int(s / 3600) + try: + h = int(s / 3600) + except: + return s s %= 3600 m = int(s / 60) s %= 60