add parts

This commit is contained in:
j 2011-08-19 14:25:46 +02:00
parent f3431fa000
commit 2140a55cbf

View file

@ -433,7 +433,8 @@ class Item(models.Model):
streams = self.streams() streams = self.streams()
i['durations'] = [s.duration for s in streams] i['durations'] = [s.duration for s in streams]
i['duration'] = sum(i['durations']) i['duration'] = sum(i['durations'])
if streams: i['parts'] = len(i['durations'])
if i['parts']:
i['videoRatio'] = streams[0].aspect_ratio i['videoRatio'] = streams[0].aspect_ratio
#only needed by admins #only needed by admins