never set display aspect ratio to 0:0

This commit is contained in:
j 2016-06-27 16:08:30 +02:00
parent 8ac78f3bd6
commit adfcc1cb27

View file

@ -108,10 +108,12 @@ class File(models.Model):
self.width = video['width'] self.width = video['width']
self.height = video['height'] self.height = video['height']
self.framerate = video['framerate'] 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'] 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) self.display_aspect_ratio = "%s:%s" % (self.width, self.height)
else:
self.display_aspect_ratio = "4:3"
self.is_video = True self.is_video = True
self.is_audio = False self.is_audio = False
if self.path.endswith('.jpg') or \ if self.path.endswith('.jpg') or \