sort profiles

This commit is contained in:
j 2011-04-01 14:31:05 +02:00
parent a49c629af8
commit 35361bff1e

View file

@ -311,7 +311,7 @@ class Item(models.Model):
stream['baseUrl'] = '/%s' % self.itemId stream['baseUrl'] = '/%s' % self.itemId
else: else:
stream['baseUrl'] = os.path.dirname(s.video.url) stream['baseUrl'] = os.path.dirname(s.video.url)
stream['profiles'] = list(set(map(lambda s: int(os.path.splitext(s['profile'])[0][:-1]), self.streams.all().values('profile')))) stream['profiles'] = sorted(list(set(map(lambda s: int(os.path.splitext(s['profile'])[0][:-1]), self.streams.all().values('profile')))))
stream['formats'] = list(set(map(lambda s: os.path.splitext(s['profile'])[1][1:], self.streams.all().values('profile')))) stream['formats'] = list(set(map(lambda s: os.path.splitext(s['profile'])[1][1:], self.streams.all().values('profile'))))
return stream return stream