From 23485bc8203f43377fab54b89af891f43915f77f Mon Sep 17 00:00:00 2001 From: rlaphoenix Date: Sun, 14 Apr 2024 02:40:16 +0100 Subject: [PATCH] refactor(Video): Return None if no m3u RANGE, not SDR --- devine/core/tracks/video.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devine/core/tracks/video.py b/devine/core/tracks/video.py index 5a3c13a..b06a118 100644 --- a/devine/core/tracks/video.py +++ b/devine/core/tracks/video.py @@ -141,9 +141,11 @@ class Video(Track): return Video.Range.SDR @staticmethod - def from_m3u_range_tag(tag: str) -> Video.Range: + def from_m3u_range_tag(tag: str) -> Optional[Video.Range]: tag = (tag or "").upper().replace('"', '').strip() - if not tag or tag == "SDR": + if not tag: + return None + if tag == "SDR": return Video.Range.SDR elif tag == "PQ": return Video.Range.HDR10 # technically could be any PQ-transfer range