From d4af01a90556bb4f257b721580539b7b88b8eb95 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 10 Nov 2012 00:28:34 +0100 Subject: [PATCH] add up volume for multi part files --- pandora/item/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 7214bd8b..fc75f337 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -790,7 +790,7 @@ class Item(models.Model): s.bitrate = s.size * 8 / s.duration else: s.bitrate = 0 - s.volume = self.data.get('volume', 0) + s.volume = self.data.get('volume', None) else: s.duration = None s.resolution = None @@ -1054,7 +1054,7 @@ class Item(models.Model): color = [0, 0, 0] n = streams.count() for s in streams: - self.data['volume'] = s.volume * s.duration + self.data['volume'] += s.volume * s.duration color = map(lambda a,b: (a+b)/n, color,ox.image.getRGB(s.color)) offset += s.duration self.data['color'] = ox.image.getHSL(color)