add parts

This commit is contained in:
j 2011-08-19 14:25:46 +02:00
parent 1d64c89fdd
commit f595dcb991

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