From adfcc1cb27ea45655cfce776e0fcb56fb61bfcbc Mon Sep 17 00:00:00 2001 From: j Date: Mon, 27 Jun 2016 16:08:30 +0200 Subject: [PATCH] never set display aspect ratio to 0:0 --- pandora/archive/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 78a95f7f..1f21659b 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -108,10 +108,12 @@ class File(models.Model): self.width = video['width'] self.height = video['height'] self.framerate = video['framerate'] - if 'display_aspect_ratio' in video: + if 'display_aspect_ratio' in video and video['display_aspect_ratio'].split(':')[-1] != '0': self.display_aspect_ratio = video['display_aspect_ratio'] - else: + elif self.width and self.height: self.display_aspect_ratio = "%s:%s" % (self.width, self.height) + else: + self.display_aspect_ratio = "4:3" self.is_video = True self.is_audio = False if self.path.endswith('.jpg') or \