From f595dcb991b8b5f0e12fc939bd28e1e3dbad535b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 19 Aug 2011 14:25:46 +0200 Subject: [PATCH] add parts --- pandora/item/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index fabe950..e05cf30 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -433,7 +433,8 @@ class Item(models.Model): streams = self.streams() i['durations'] = [s.duration for s in streams] i['duration'] = sum(i['durations']) - if streams: + i['parts'] = len(i['durations']) + if i['parts']: i['videoRatio'] = streams[0].aspect_ratio #only needed by admins