From a7a82f4ebba7f2fdde755d35c20eb1ec14f838b3 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Thu, 24 Dec 2015 18:02:31 -0600 Subject: [PATCH] Fix AR --- resources/lib/api.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/lib/api.py b/resources/lib/api.py index d15822bb..4dbdcbfc 100644 --- a/resources/lib/api.py +++ b/resources/lib/api.py @@ -165,12 +165,14 @@ class API(): aspectwidth, aspectheight = aspectratio.split(':') track['aspectratio'] = round(float(aspectwidth) / float(aspectheight), 6) - except ValueError: - width = track['width'] - height = track['height'] + except (ValueError, ZeroDivisionError): + width = track.get('width') + height = track.get('height') if width and height: track['aspectratio'] = round(float(width / height), 6) + else: + track['aspectratio'] = 1.85 videotracks.append(track)