From 43fc7eebfeb820b7113e7cd4642f29158a75a6e3 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 10 May 2025 16:26:12 -0700 Subject: [PATCH] Update is_hdr helper function --- plexpy/exporter.py | 2 +- plexpy/helpers.py | 4 ++-- plexpy/pmsconnect.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plexpy/exporter.py b/plexpy/exporter.py index 2733321e..b1e07de2 100644 --- a/plexpy/exporter.py +++ b/plexpy/exporter.py @@ -729,7 +729,7 @@ class Export(object): 'frameRate': None, 'frameRateMode': None, 'hasScalingMatrix': None, - 'hdr': lambda o: helpers.is_hdr(getattr(o, 'bitDepth', 0), getattr(o, 'colorSpace', '')), + 'hdr': lambda o: helpers.is_hdr(getattr(o, 'bitDepth', 0), getattr(o, 'colorTrc', '')), 'height': None, 'level': None, 'pixelAspectRatio': None, diff --git a/plexpy/helpers.py b/plexpy/helpers.py index fdb79830..ddf100d1 100644 --- a/plexpy/helpers.py +++ b/plexpy/helpers.py @@ -1483,9 +1483,9 @@ def move_to_front(l, value): return l -def is_hdr(bit_depth, color_space): +def is_hdr(bit_depth, color_trc): bit_depth = cast_to_int(bit_depth) - return bit_depth > 8 and color_space == 'bt2020nc' + return bit_depth > 8 and (color_trc == 'smpte2084' or color_trc == 'arib-std-b67') def version_to_tuple(version): diff --git a/plexpy/pmsconnect.py b/plexpy/pmsconnect.py index ed115897..ac23ce82 100644 --- a/plexpy/pmsconnect.py +++ b/plexpy/pmsconnect.py @@ -3391,7 +3391,7 @@ class PmsConnect(object): color_trc = helpers.get_xml_attr(stream, 'colorTrc') DOVI_profile = helpers.get_xml_attr(stream, 'DOVIProfile') - HDR = bool(bit_depth > 8 and (color_trc == 'smpte2084' or color_trc == 'arib-std-b67')) + HDR = helpers.is_hdr(bit_depth, color_trc) DV = bool(DOVI_profile) if not HDR and not DV: