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.info = stream.info
stream.file.save() stream.file.save()
#link streams #link streams
resolution = settings.CONFIG['video']['resolutions'][0] resolution = max(settings.CONFIG['video']['resolutions'])
format = settings.CONFIG['video']['formats'][0] format = settings.CONFIG['video']['formats'][0]
for s in models.Stream.objects.exclude(format=format, resolution=resolution).filter(source=None): 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) 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'] config = settings.CONFIG['video']
stream, created = Stream.objects.get_or_create( stream, created = Stream.objects.get_or_create(
file=self, file=self,
resolution=config['resolutions'][0], resolution=max(config['resolutions']),
format=config['formats'][0]) format=config['formats'][0])
if created: if created:
stream.video.name = stream.path(stream.name()) stream.video.name = stream.path(stream.name())

View file

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