From 8beaf10fb49c942e3cddfbdb196806ab343f06c8 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 23 Dec 2010 00:15:41 +0530 Subject: [PATCH] defaults --- pandora/item/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index e2f06555..e32790b8 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -562,6 +562,15 @@ class Item(models.Model): s.filename = ' '.join([v.name for v in videos]) s.files = self.files.all().count() s.size = sum([v.size for v in videos]) #FIXME: only size of movies? + else: + s.duration = 0 + s.resolution = 0 + s.aspectratio = 0 + s.bitrate = 0 + s.pixels = 0 + s.filename = 0 + s.files = 0 + s.size = 0 for key in ('title', 'language', 'country') + self.person_keys: setattr(s, '%s_desc'%key, getattr(s, key))