From db8485ca6139ff6391565bb78f908e7b3f9969c5 Mon Sep 17 00:00:00 2001 From: Michael Cresswell Date: Sun, 27 Oct 2024 11:49:32 -0400 Subject: [PATCH 1/3] Add channel number to Live TV channel title --- components/data/ChannelData.bs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/data/ChannelData.bs b/components/data/ChannelData.bs index ff4ec8189..f7080839e 100644 --- a/components/data/ChannelData.bs +++ b/components/data/ChannelData.bs @@ -5,7 +5,11 @@ import "pkg:/source/utils/config.bs" sub setFields() json = m.top.json m.top.id = json.id - m.top.title = json.name + if json.number <> "" + m.top.title = json.number + " " + json.name + else + m.top.title = json.name + end if m.top.live = true m.top.Type = "TvChannel" setPoster() From 572cce8f775e1a633e8f3ff0d05ccb362832b8c6 Mon Sep 17 00:00:00 2001 From: Michael Cresswell Date: Mon, 28 Oct 2024 16:27:45 -0400 Subject: [PATCH 2/3] Make more robust with validation function and string template --- components/data/ChannelData.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/data/ChannelData.bs b/components/data/ChannelData.bs index f7080839e..3f5f3998b 100644 --- a/components/data/ChannelData.bs +++ b/components/data/ChannelData.bs @@ -5,8 +5,8 @@ import "pkg:/source/utils/config.bs" sub setFields() json = m.top.json m.top.id = json.id - if json.number <> "" - m.top.title = json.number + " " + json.name + if isValid(json.number) + m.top.title = `CH ${json.number} ${json.name}` else m.top.title = json.name end if From dae7677dbe6f1fc0a2ad001cfcd11a6b1290d320 Mon Sep 17 00:00:00 2001 From: Michael Cresswell Date: Wed, 6 Nov 2024 15:49:34 -0500 Subject: [PATCH 3/3] Add localization for channel abbreviation string --- components/data/ChannelData.bs | 2 +- locale/en_US/translations.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/components/data/ChannelData.bs b/components/data/ChannelData.bs index 3f5f3998b..e9bc35f01 100644 --- a/components/data/ChannelData.bs +++ b/components/data/ChannelData.bs @@ -6,7 +6,7 @@ sub setFields() json = m.top.json m.top.id = json.id if isValid(json.number) - m.top.title = `CH ${json.number} ${json.name}` + m.top.title = `${tr("CH")} ${json.number} ${json.name}` else m.top.title = json.name end if diff --git a/locale/en_US/translations.ts b/locale/en_US/translations.ts index 14445ef91..2bfc46dc0 100644 --- a/locale/en_US/translations.ts +++ b/locale/en_US/translations.ts @@ -1371,5 +1371,10 @@ Special Special episode of a TV Show + + CH + CH + Abbreviation for Channel + \ No newline at end of file