use max resolutions not first

This commit is contained in:
j 2013-03-04 15:39:08 +00:00
parent ffc7b693a7
commit b9a01b2db9
3 changed files with 3 additions and 3 deletions

View File

@ -43,7 +43,7 @@ class Command(BaseCommand):
stream.file.info = stream.info
stream.file.save()
#link streams
resolution = settings.CONFIG['video']['resolutions'][0]
resolution = max(settings.CONFIG['video']['resolutions'])
format = settings.CONFIG['video']['formats'][0]
for s in models.Stream.objects.exclude(format=format, resolution=resolution).filter(source=None):
s.source = models.Stream.objects.get(file=s.file, resolution=resolution, format=format)

View File

@ -250,7 +250,7 @@ class File(models.Model):
config = settings.CONFIG['video']
stream, created = Stream.objects.get_or_create(
file=self,
resolution=config['resolutions'][0],
resolution=max(config['resolutions']),
format=config['formats'][0])
if created:
stream.video.name = stream.path(stream.name())

View File

@ -1232,7 +1232,7 @@ class Item(models.Model):
elif frames:
path = frames[int(len(frames)/2)]['path']
else:
size = settings.CONFIG['video']['resolutions'][0]
size = max(settings.CONFIG['video']['resolutions'])
path = self.frame(self.poster_frame, size)
return path