From b9a01b2db9b4be848300ba0df506cf4b2a6cca34 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 4 Mar 2013 15:39:08 +0000 Subject: [PATCH] use max resolutions not first --- pandora/archive/management/commands/import_streams.py | 2 +- pandora/archive/models.py | 2 +- pandora/item/models.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora/archive/management/commands/import_streams.py b/pandora/archive/management/commands/import_streams.py index 573177f5..255db0f1 100644 --- a/pandora/archive/management/commands/import_streams.py +++ b/pandora/archive/management/commands/import_streams.py @@ -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) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 125ad498..7e322bfc 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -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()) diff --git a/pandora/item/models.py b/pandora/item/models.py index 2a7cc43e..670557f1 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -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