Skip to content
Open
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: 10 additions & 3 deletions components/data/ChannelData.bs
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import "pkg:/source/api/Image.bs"
import "pkg:/source/api/baserequest.bs"
import "pkg:/source/api/Image.bs"
import "pkg:/source/enums/LiveTVChannelTitle.bs"
import "pkg:/source/utils/config.bs"

sub setFields()
channelTitleContent = chainLookupReturn(m.global.session, "user.settings.tvChannelTitleInfo", LiveTVChannelTitle.NUMBERANDNAME)

json = m.top.json
m.top.id = json.id
if isValid(json.number)
m.top.title = `${tr("CH")} ${json.number} ${json.name}`
if not isStringEqual(channelTitleContent, LiveTVChannelTitle.NAME) and isValid(json.number)
if isStringEqual(channelTitleContent, LiveTVChannelTitle.NUMBERANDNAME)
m.top.title = `${tr("CH")} ${json.number} ${json.name}`
else if isStringEqual(channelTitleContent, LiveTVChannelTitle.NUMBER)
m.top.title = `${tr("CH")} ${json.number}`
end if
else
m.top.title = json.name
end if
Expand Down
23 changes: 19 additions & 4 deletions components/liveTv/ChannelInfo.bs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import "pkg:/source/enums/ColorPalette.bs"
import "pkg:/source/enums/LiveTVChannelIdentifier.bs"
import "pkg:/source/enums/PosterLoadStatus.bs"
import "pkg:/source/utils/misc.bs"

Expand All @@ -17,14 +18,28 @@ sub init()
end sub

sub onWidthChanged()
logoWidth = int(m.top.width / 3)
channelIdentifier = chainLookupReturn(m.global.session, "user.settings.tvGuideChannelDisplay", LiveTVChannelIdentifier.LOGOANDTITLE)

titleTranslationHorizontal = logoWidth + 10
titleWidth = m.top.width - titleTranslationHorizontal
if isStringEqual(channelIdentifier, LiveTVChannelIdentifier.LOGOANDTITLE)
m.channelLogo.visible = true
m.channelTitle.visible = true
logoWidth = int(m.top.width / 3)
titleWidth = m.top.width - logoWidth
else if isStringEqual(channelIdentifier, LiveTVChannelIdentifier.TITLE)
m.channelLogo.visible = false
m.channelTitle.visible = true
logoWidth = 0
titleWidth = m.top.width
else
m.channelLogo.visible = true
m.channelTitle.visible = false
logoWidth = m.top.width
titleWidth = 0
end if

m.channelLogo.width = logoWidth
m.channelLogo.translation = [titleWidth, 0]
m.channelTitle.maxWidth = titleWidth
m.channelTitle.translation = [titleTranslationHorizontal, 0]

m.borderTop.width = m.top.width
m.backdrop.width = m.top.width
Expand Down
4 changes: 2 additions & 2 deletions components/liveTv/ChannelInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<children>
<Rectangle id="backdrop" />

<ScrollingText id="channelTitle" horizAlign="left" vertAlign="center" translation="[10, 0]" />
<Poster id="channelLogo" translation="[0, 0]" loadDisplayMode="scaleToFit" />
<ScrollingText id="channelTitle" horizAlign="center" vertAlign="center" translation="[0, 0]" />
<Poster id="channelLogo" translation="[10, 0]" loadDisplayMode="scaleToFit" />

<Rectangle id="borderTop" height="1" />
</children>
Expand Down
60 changes: 60 additions & 0 deletions locale/en_US/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2327,5 +2327,65 @@
<source>Screen Settings</source>
<translation>Screen Settings</translation>
</message>
<message>
<source>Settings relating to Live TV.</source>
<translation>Settings relating to Live TV.</translation>
<extracomment>Libraries Setting - Setting Category description</extracomment>
</message>
<message>
<source>Channel Title Info</source>
<translation>Channel Title Info</translation>
<extracomment>Libraries Setting - Setting title</extracomment>
</message>
<message>
<source>Select what information to use as a channel's title.</source>
<translation>Select what information to use as a channel's title.</translation>
<extracomment>Libraries Setting - Setting description</extracomment>
</message>
<message>
<source>Settings relating to Live TV.</source>
<translation>Settings relating to Live TV.</translation>
<extracomment>Libraries Setting - Setting description</extracomment>
</message>
<message>
<source>Channel Number and Name</source>
<translation>Channel Number and Name</translation>
<extracomment>Libraries Setting - Setting option</extracomment>
</message>
<message>
<source>Channel Number</source>
<translation>Channel Number</translation>
<extracomment>Libraries Setting - Setting option</extracomment>
</message>
<message>
<source>Channel Name</source>
<translation>Channel Name</translation>
<extracomment>Libraries Setting - Setting option</extracomment>
</message>
<message>
<source>TV Guide Channel Display</source>
<translation>TV Guide Channel Display</translation>
<extracomment>Libraries Setting - Setting title</extracomment>
</message>
<message>
<source>Select how to display a channel in the Live TV guide.</source>
<translation>Select how to display a channel in the Live TV guide.</translation>
<extracomment>Libraries Setting - Setting description</extracomment>
</message>
<message>
<source>Channel Logo and Title</source>
<translation>Channel Logo and Title</translation>
<extracomment>Libraries Setting - Setting option</extracomment>
</message>
<message>
<source>Channel Logo</source>
<translation>Channel Logo</translation>
<extracomment>Libraries Setting - Setting option</extracomment>
</message>
<message>
<source>Channel Title</source>
<translation>Channel Title</translation>
<extracomment>Libraries Setting - Setting option</extracomment>
</message>
</context>
</TS>
50 changes: 49 additions & 1 deletion settings/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,54 @@
}
]
},
{
"title": "Live TV",
"description": "Settings relating to Live TV.",
"children": [
{
"title": "Channel Title Info",
"description": "Select what information to use as a channel's title.",
"settingName": "tvChannelTitleInfo",
"type": "radio",
"default": "numberName",
"options": [
{
"title": "Channel Number and Name",
"id": "numberName"
},
{
"title": "Channel Number",
"id": "number"
},
{
"title": "Channel Name",
"id": "name"
}
]
},
{
"title": "TV Guide Channel Display",
"description": "Select how to display a channel in the Live TV guide.",
"settingName": "tvGuideChannelDisplay",
"type": "radio",
"default": "logoTitle",
"options": [
{
"title": "Channel Logo and Title",
"id": "logoTitle"
},
{
"title": "Channel Logo",
"id": "logo"
},
{
"title": "Channel Title",
"id": "title"
}
]
}
]
},
{
"title": "Load Items Limit",
"description": "Number of items to load together on library screens.",
Expand Down Expand Up @@ -1342,4 +1390,4 @@
"visible": false,
"children": []
}
]
]
5 changes: 5 additions & 0 deletions source/enums/LiveTVChannelIdentifier.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enum LiveTVChannelIdentifier
LOGOANDTITLE = "logoTitle"
LOGO = "logo"
TITLE = "title"
end enum
5 changes: 5 additions & 0 deletions source/enums/LiveTVChannelTitle.bs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enum LiveTVChannelTitle
NUMBERANDNAME = "numberName"
NUMBER = "number"
NAME = "name"
end enum
10 changes: 7 additions & 3 deletions source/static/whatsNew/3.1.8.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
},
{
"description": "Fix subtitle background opacity affecting text",
"author": "gabeluci"
},
"author": "gabeluci"
},
{
"description": "Prevent subtitles from getting too close to the top or bottom of the screen",
"author": "gabeluci"
Expand All @@ -30,5 +30,9 @@
{
"description": "Add setting to select how many items are loaded together on library screens",
"author": "brianpardy"
},
{
"description": "Add setting to configure Live TV channel title and logo visibility",
"author": "michaelcresswell"
}
]
]