From 3baeeb62bbe1f4eba9bb36772b637045147720a4 Mon Sep 17 00:00:00 2001 From: Michael Cresswell Date: Fri, 8 Nov 2024 16:07:14 -0500 Subject: [PATCH] Add Live TV series title, season number, and episode number to OSD, when available --- components/ItemGrid/LoadVideoContentTask.bs | 15 +++++++++++++++ components/video/VideoPlayerView.bs | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/components/ItemGrid/LoadVideoContentTask.bs b/components/ItemGrid/LoadVideoContentTask.bs index 69a5cce0c..6dc5d7b01 100644 --- a/components/ItemGrid/LoadVideoContentTask.bs +++ b/components/ItemGrid/LoadVideoContentTask.bs @@ -115,6 +115,21 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s end if end if + if videotype = "tvchannel" and isValid(meta.json) and isValid(meta.json.CurrentProgram) + if isValid(meta.json.CurrentProgram.Name) + meta.title = `${meta.title}: ${meta.json.CurrentProgram.Name}` + end if + if isValid(meta.json.CurrentProgram.ParentIndexNumber) + video.seasonNumber = meta.json.CurrentProgram.ParentIndexNumber + end if + if isValid(meta.json.CurrentProgram.IndexNumber) + video.episodeNumber = meta.json.CurrentProgram.IndexNumber + end if + if isValid(meta.json.CurrentProgram.IndexNumberEnd) + video.episodeNumberEnd = meta.json.CurrentProgram.IndexNumberEnd + end if + end if + video.chapters = meta.json.Chapters video.content.title = meta.title video.showID = meta.showID diff --git a/components/video/VideoPlayerView.bs b/components/video/VideoPlayerView.bs index 109a5569c..7fd76714b 100644 --- a/components/video/VideoPlayerView.bs +++ b/components/video/VideoPlayerView.bs @@ -412,7 +412,7 @@ sub onVideoContentLoaded() m.osd.itemTitleText = m.top.content.title ' If video is an episode, attempt to add season and episode numbers to OSD - if m.top.content.contenttype = 4 + if m.top.content.contenttype = 4 or m.top.content.live if isValid(videoContent[0].seasonNumber) m.osd.seasonNumber = videoContent[0].seasonNumber end if