From 0bb4a26c33d29123ed868cf06e07834b52868719 Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Wed, 26 Oct 2016 21:14:58 +0200 Subject: [PATCH] Fix for missing Plex item bitDepth - Fixes #130 --- resources/lib/PlexAPI.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/resources/lib/PlexAPI.py b/resources/lib/PlexAPI.py index db4921c8..c9205342 100644 --- a/resources/lib/PlexAPI.py +++ b/resources/lib/PlexAPI.py @@ -1692,7 +1692,7 @@ class API(): 'bitDepth': xxx e.g. '8', '10' } """ - return { + answ = { 'videocodec': self.getDataFromPartOrMedia('videoCodec'), 'resolution': self.getDataFromPartOrMedia('videoResolution'), 'height': self.getDataFromPartOrMedia('height'), @@ -1700,8 +1700,12 @@ class API(): 'aspectratio': self.getDataFromPartOrMedia('aspectratio'), 'bitrate': self.getDataFromPartOrMedia('bitrate'), 'container': self.getDataFromPartOrMedia('container'), - 'bitDepth': self.item[0][self.part][self.mediastream].attrib.get('bitDepth') } + try: + answ['bitDepth'] = self.item[0][self.part][self.mediastream].attrib.get('bitDepth') + except: + answ['bitDepth'] = None + return answ def getExtras(self): """