This commit is contained in:
angelblue05 2015-12-24 18:02:31 -06:00
parent 8f207b820b
commit a7a82f4ebb

View file

@ -165,12 +165,14 @@ class API():
aspectwidth, aspectheight = aspectratio.split(':') aspectwidth, aspectheight = aspectratio.split(':')
track['aspectratio'] = round(float(aspectwidth) / float(aspectheight), 6) track['aspectratio'] = round(float(aspectwidth) / float(aspectheight), 6)
except ValueError: except (ValueError, ZeroDivisionError):
width = track['width'] width = track.get('width')
height = track['height'] height = track.get('height')
if width and height: if width and height:
track['aspectratio'] = round(float(width / height), 6) track['aspectratio'] = round(float(width / height), 6)
else:
track['aspectratio'] = 1.85
videotracks.append(track) videotracks.append(track)