Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass HDR library metadata to kodi to display logos #804

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions jellyfin_kodi/helper/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,20 @@ def video_streams(self, tracks, container=None):

for track in tracks:

if "DvProfile" in track:
track['hdrtype'] = "dolbyvision"

elif track['VideoRangeType'] in ["HDR10", "HDR10Plus"]:
track['hdrtype'] = "hdr10"

elif "HLG" in track['VideoRangeType']:
track['hdrtype'] = "hlg"

elif track['VideoRangeType'] in ["SDR", "Unknown"]:
track['hdrtype'] = ""

track.update({
'hdrtype': track.get('hdrtype', "").lower(),
'codec': track.get('Codec', "").lower(),
'profile': track.get('Profile', "").lower(),
'height': track.get('Height'),
Expand Down
1 change: 1 addition & 0 deletions jellyfin_kodi/objects/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def listitem_video(self, obj, listitem, item, seektime=None, intro=False):

for track in obj['Streams']['video']:
listitem.addStreamInfo('video', {
'hdrtype': track['hdrtype'],
'duration': obj['Runtime'],
'aspect': track['aspect'],
'codec': track['codec'],
Expand Down
6 changes: 3 additions & 3 deletions jellyfin_kodi/objects/kodi/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@
add_streams_obj = ["{FileId}", "{Streams}", "{Runtime}"]
add_stream_video = """
INSERT INTO streamdetails(idFile, iStreamType, strVideoCodec, fVideoAspect, iVideoWidth,
iVideoHeight, iVideoDuration, strStereoMode)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
iVideoHeight, iVideoDuration, strStereoMode, strHdrType)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
"""
add_stream_video_obj = ["{FileId}", 0, "{codec}", "{aspect}", "{width}", "{height}", "{Runtime}", "{3d}"]
add_stream_video_obj = ["{FileId}", 0, "{codec}", "{aspect}", "{width}", "{height}", "{Runtime}", "{3d}", "{hdrtype}"]
add_stream_audio = """
INSERT INTO streamdetails(idFile, iStreamType, strAudioCodec, iAudioChannels, strAudioLanguage)
VALUES (?, ?, ?, ?, ?)
Expand Down