From 9b4c87b867003ab92a98f3845c4cce3e84997357 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 30 Sep 2011 15:46:26 +0200 Subject: [PATCH] check that duration is no 0 --- pandora/item/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 86472991a..0b414fecb 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -649,7 +649,10 @@ class Item(models.Model): s.numberoffiles = self.files.all().count() s.parts = videos.count() s.size = sum([v.size for v in videos]) #FIXME: only size of movies? - s.bitrate = s.size * 8 / s.duration + if s.duration: + s.bitrate = s.size * 8 / s.duration + else: + s.bitrate = 0 s.volume = 0 else: s.duration = None