Simplify logic

This commit is contained in:
Odd Stråbø 2024-08-10 10:24:10 +00:00
parent d258f0d14c
commit 9eb9cd1e61
2 changed files with 4 additions and 6 deletions

View file

@ -385,13 +385,10 @@ class PlayUtils(object):
def get_transcoding_video_codec(self):
codecs = ["h264", "mpeg4", "mpeg2video", "vc1"]
if not settings("transcode_h265.bool"):
codecs.insert(1, "hevc") # Add HEVC if transcoding is not forced
if settings("videoPreferredCodec") == "H265/HEVC":
if "hevc" in codecs:
codecs.remove("hevc")
codecs.insert(0, "hevc") # Add HEVC at the beginning if preferred
codecs.insert(0, "hevc")
elif not settings("transcode_h265.bool"):
codecs.insert(1, "hevc")
if settings("transcode_mpeg2.bool"):
codecs.remove("mpeg2video")

View file

@ -34,6 +34,7 @@ class PatchedSettings:
setting = setting.replace(".bool", "")
value = bool(value)
cls.settings[setting] = value
return None
@classmethod
def clear(cls):