From bc8cae985075257e764ccfaefabfe0e0690bd791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Tue, 9 Apr 2024 03:42:58 +0200 Subject: [PATCH] Gracefully handle missing VideoRangeType in stream tracks --- jellyfin_kodi/helper/api.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/jellyfin_kodi/helper/api.py b/jellyfin_kodi/helper/api.py index 5ae68eda8..7ac839ad2 100644 --- a/jellyfin_kodi/helper/api.py +++ b/jellyfin_kodi/helper/api.py @@ -75,15 +75,10 @@ def video_streams(self, tracks, container=None): if "DvProfile" in track: track['hdrtype'] = "dolbyvision" - - elif track['VideoRangeType'] in ["HDR10", "HDR10Plus"]: + elif track.get('VideoRangeType', '') in ["HDR10", "HDR10Plus"]: track['hdrtype'] = "hdr10" - - elif "HLG" in track['VideoRangeType']: + elif "HLG" in track.get('VideoRangeType', ''): track['hdrtype'] = "hlg" - - elif track['VideoRangeType'] in ["SDR", "Unknown"]: - track['hdrtype'] = "" track.update({ 'hdrtype': track.get('hdrtype', "").lower(),