From 1bd63ddc91eea6a89f069e3df4885a6a4b8c4860 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 5 Aug 2025 18:33:51 +0000 Subject: [PATCH] feat(titles): Better detection of DV across all codecs in Episode and Movie classes dvhe.05.06 was not being detected correctly. --- unshackle/core/titles/episode.py | 5 +++-- unshackle/core/titles/movie.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/unshackle/core/titles/episode.py b/unshackle/core/titles/episode.py index 119409f..0d16e96 100644 --- a/unshackle/core/titles/episode.py +++ b/unshackle/core/titles/episode.py @@ -170,8 +170,9 @@ class Episode(Title): frame_rate = float(primary_video_track.frame_rate) if hdr_format: if (primary_video_track.hdr_format or "").startswith("Dolby Vision"): - if (primary_video_track.hdr_format_commercial) != "Dolby Vision": - name += f" DV {DYNAMIC_RANGE_MAP.get(hdr_format)} " + name += " DV" + if DYNAMIC_RANGE_MAP.get(hdr_format) and DYNAMIC_RANGE_MAP.get(hdr_format) != "DV": + name += " HDR" else: name += f" {DYNAMIC_RANGE_MAP.get(hdr_format)} " elif trc and "HLG" in trc: diff --git a/unshackle/core/titles/movie.py b/unshackle/core/titles/movie.py index 06a4a93..3d552d2 100644 --- a/unshackle/core/titles/movie.py +++ b/unshackle/core/titles/movie.py @@ -121,8 +121,9 @@ class Movie(Title): frame_rate = float(primary_video_track.frame_rate) if hdr_format: if (primary_video_track.hdr_format or "").startswith("Dolby Vision"): - if (primary_video_track.hdr_format_commercial) != "Dolby Vision": - name += f" DV {DYNAMIC_RANGE_MAP.get(hdr_format)} " + name += " DV" + if DYNAMIC_RANGE_MAP.get(hdr_format) and DYNAMIC_RANGE_MAP.get(hdr_format) != "DV": + name += " HDR" else: name += f" {DYNAMIC_RANGE_MAP.get(hdr_format)} " elif trc and "HLG" in trc: