From 90c7d68d15ea137800930431ca2e58d705671d79 Mon Sep 17 00:00:00 2001 From: angelblue05 Date: Fri, 31 Jul 2015 16:13:32 -0500 Subject: [PATCH] Fix for aspect ratio --- resources/lib/API.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/lib/API.py b/resources/lib/API.py index 12b1823b..74fde91b 100644 --- a/resources/lib/API.py +++ b/resources/lib/API.py @@ -148,9 +148,12 @@ class API(): aspectwidth, aspectheight = videotrack['aspectratio'].split(':') videotrack['aspectratio'] = round(float(aspectwidth) / float(aspectheight), 6) except: - videotrack['aspectratio'] = round(float(videotrack['width'] / videotrack['height']), 6) + videotrack['aspectratio'] = 1.85 else: - videotrack['aspectratio'] = round(float(videotrack['width'] / videotrack['height']), 6) + try: + videotrack['aspectratio'] = round(float(videotrack['width'] / videotrack['height']), 6) + except: # In the event the aspect ratio is missing and the width and height are missing as well. + videotrack['aspectratio'] = 1.85 videotracks.append(videotrack) elif "Audio" in type: