From 9c173ba0a331b50141b1b03e32dafac0ceba1b3a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 7 Nov 2011 16:32:50 +0100 Subject: [PATCH] dont get color for clips outside item duration --- pandora/clip/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/clip/models.py b/pandora/clip/models.py index 10c0056ca..e8c194578 100644 --- a/pandora/clip/models.py +++ b/pandora/clip/models.py @@ -11,7 +11,9 @@ import managers class MetaClip: def update_calculated_values(self): - self.duration = self.end - self.start + start = min(self.start, self.item.sort.duration) + end = min(self.end, self.item.sort.duration) + self.duration = end - start if self.duration > 0: self.hue, self.saturation, self.lightness = extract.average_color( self.item.timeline_prefix, self.start, self.end)