duration might not be set

This commit is contained in:
j 2014-03-17 10:08:27 +00:00
parent c3b4a622ad
commit 3476a50c53

View file

@ -1352,7 +1352,7 @@ class Item(models.Model):
}) })
offset += f.duration offset += f.duration
else: else:
if 'videoRatio' in self.json: if 'videoRatio' in self.json and self.sort.duration:
width, height = self.json['resolution'] width, height = self.json['resolution']
pos = self.sort.duration / 2 pos = self.sort.duration / 2
for p in map(int, [pos/2, pos, pos+pos/2]): for p in map(int, [pos/2, pos, pos+pos/2]):