From a56428620a917fa14d062ca387924c8a17112388 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 14 Nov 2014 14:05:45 +0000 Subject: [PATCH] dont try to extract frames from audio --- pandora/item/models.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 532ca92d6..24187000c 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1394,16 +1394,17 @@ class Item(models.Model): else: if 'videoRatio' in self.json and self.sort.duration: width, height = self.json['resolution'] - pos = self.sort.duration / 2 - for p in map(int, [pos/2, pos, pos+pos/2]): - path = self.frame(p, height) - if path: - frames.append({ - 'position': p, - 'path': path, - 'width': width, - 'height': height, - }) + if width and height: + pos = self.sort.duration / 2 + for p in map(int, [pos/2, pos, pos+pos/2]): + path = self.frame(p, height) + if path: + frames.append({ + 'position': p, + 'path': path, + 'width': width, + 'height': height, + }) return frames def select_frame(self):