Skip to content

Commit

Permalink
Simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
oddstr13 committed Aug 10, 2024
1 parent d258f0d commit 9eb9cd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions jellyfin_kodi/helper/playutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,10 @@ def get_directplay_video_codec(self):
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")
Expand Down
1 change: 1 addition & 0 deletions tests/test_playutils_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __call__(cls, setting: str, value=None):
setting = setting.replace(".bool", "")
value = bool(value)
cls.settings[setting] = value
return None

@classmethod
def clear(cls):
Expand Down

0 comments on commit 9eb9cd1

Please sign in to comment.