From 999de04ad87bb408c69be8b97438841e696a381f Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 3 Sep 2014 13:31:44 +0200 Subject: [PATCH] only use frames that are ready. --- pandora/item/models.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 2f7ab577..672bd00a 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1380,12 +1380,13 @@ class Item(models.Model): offset = 0 for f in self.files.filter(selected=True, is_video=True).order_by('sort_path'): for ff in f.frames.all().order_by('position'): - frames.append({ - 'position': offset + ff.position, - 'path': ff.frame.path, - 'width': ff.frame.width, - 'height': ff.frame.height - }) + if ff.frame: + frames.append({ + 'position': offset + ff.position, + 'path': ff.frame.path, + 'width': ff.frame.width, + 'height': ff.frame.height + }) offset += f.duration else: if 'videoRatio' in self.json and self.sort.duration: