Initial batch of livetv updates to itemgrid2
This commit is contained in:
parent
419c4a4829
commit
dd391ff0ea
|
@ -29,6 +29,9 @@ sub itemContentChanged()
|
||||||
else if itemData.type = "Boxset" then
|
else if itemData.type = "Boxset" then
|
||||||
m.itemPoster.uri = itemData.PosterUrl
|
m.itemPoster.uri = itemData.PosterUrl
|
||||||
m.itemText.text = itemData.Title
|
m.itemText.text = itemData.Title
|
||||||
|
else if itemData.type = "TvChannel" then
|
||||||
|
m.itemPoster.uri = itemData.PosterUrl
|
||||||
|
m.itemText.text = itemData.Title
|
||||||
else
|
else
|
||||||
print "Unhandled Item Type: " + itemData.type
|
print "Unhandled Item Type: " + itemData.type
|
||||||
end if
|
end if
|
||||||
|
|
|
@ -51,6 +51,10 @@ sub loadInitialItems()
|
||||||
m.loadItemsTask.itemType = "Movie"
|
m.loadItemsTask.itemType = "Movie"
|
||||||
else if m.top.parentItem.collectionType = "tvshows" then
|
else if m.top.parentItem.collectionType = "tvshows" then
|
||||||
m.loadItemsTask.itemType = "Series"
|
m.loadItemsTask.itemType = "Series"
|
||||||
|
else if m.top.parentItem.collectionType = "livetv" then
|
||||||
|
m.loadItemsTask.itemType = "LiveTV"
|
||||||
|
else
|
||||||
|
print "Unknown Type: " m.top.parentItem
|
||||||
end if
|
end if
|
||||||
|
|
||||||
m.loadItemsTask.control = "RUN"
|
m.loadItemsTask.control = "RUN"
|
||||||
|
@ -89,6 +93,12 @@ sub SetUpOptions()
|
||||||
{ "Title": tr("OFFICIAL_RATING"), "Name": "OfficialRating" },
|
{ "Title": tr("OFFICIAL_RATING"), "Name": "OfficialRating" },
|
||||||
{ "Title": tr("RELEASE_DATE"), "Name": "PremiereDate" },
|
{ "Title": tr("RELEASE_DATE"), "Name": "PremiereDate" },
|
||||||
]
|
]
|
||||||
|
'Live TV
|
||||||
|
else if m.top.parentItem.collectionType = "livetv" then
|
||||||
|
options.views = [{"Title": tr("Live TV"), "Name": "livetv" }]
|
||||||
|
options.sort = [
|
||||||
|
{ "Title": tr("TITLE"), "Name": "SortName" }
|
||||||
|
]
|
||||||
|
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,11 @@ sub loadItems()
|
||||||
params.append({ IncludeItemTypes: m.top.ItemType})
|
params.append({ IncludeItemTypes: m.top.ItemType})
|
||||||
end if
|
end if
|
||||||
|
|
||||||
url = Substitute("Users/{0}/Items/", get_setting("active_user"))
|
if m.top.ItemType = "LiveTV" then
|
||||||
|
url = "LiveTv/Channels"
|
||||||
|
else
|
||||||
|
url = Substitute("Users/{0}/Items/", get_setting("active_user"))
|
||||||
|
end if
|
||||||
resp = APIRequest(url, params)
|
resp = APIRequest(url, params)
|
||||||
data = getJson(resp)
|
data = getJson(resp)
|
||||||
|
|
||||||
|
@ -45,6 +49,8 @@ sub loadItems()
|
||||||
tmp = CreateObject("roSGNode", "SeriesData")
|
tmp = CreateObject("roSGNode", "SeriesData")
|
||||||
else if item.Type = "BoxSet" then
|
else if item.Type = "BoxSet" then
|
||||||
tmp = CreateObject("roSGNode", "CollectionData")
|
tmp = CreateObject("roSGNode", "CollectionData")
|
||||||
|
else if item.Type = "TvChannel" then
|
||||||
|
tmp = CreateObject("roSGNode", "ChannelData")
|
||||||
else
|
else
|
||||||
print "Unknown Type: " item.Type
|
print "Unknown Type: " item.Type
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ sub recountPages()
|
||||||
|
|
||||||
m.top.pageFocused = m.top.findNode(stri(currentPage).trim())
|
m.top.pageFocused = m.top.findNode(stri(currentPage).trim())
|
||||||
|
|
||||||
m.top.pageFocused.color = "#00ff00ff"
|
m.top.pageFocused.color = "#00A4DCff"
|
||||||
|
|
||||||
updateLayout()
|
updateLayout()
|
||||||
end sub
|
end sub
|
||||||
|
@ -105,7 +105,7 @@ sub focusNext()
|
||||||
|
|
||||||
m.top.pageFocused.color = "#a1a1a1FF"
|
m.top.pageFocused.color = "#a1a1a1FF"
|
||||||
m.top.pageFocused = m.top.getChild(i + 1)
|
m.top.pageFocused = m.top.getChild(i + 1)
|
||||||
m.top.pageFocused.color = "#00ff00ff"
|
m.top.pageFocused.color = "#00A4DCff"
|
||||||
m.top.pageFocused.setFocus(true)
|
m.top.pageFocused.setFocus(true)
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ sub focusPrev()
|
||||||
|
|
||||||
m.top.pageFocused.color = "#a1a1a1FF"
|
m.top.pageFocused.color = "#a1a1a1FF"
|
||||||
m.top.pageFocused = m.top.getChild(i - 1)
|
m.top.pageFocused = m.top.getChild(i - 1)
|
||||||
m.top.pageFocused.color = "#00ff00ff"
|
m.top.pageFocused.color = "#00A4DCff"
|
||||||
m.top.pageFocused.setFocus(true)
|
m.top.pageFocused.setFocus(true)
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,8 @@ sub setFields()
|
||||||
json = m.top.json
|
json = m.top.json
|
||||||
|
|
||||||
m.top.id = json.id
|
m.top.id = json.id
|
||||||
m.top.title = json.name
|
m.top.Title = json.name
|
||||||
m.top.live = true
|
m.top.Type = "TvChannel"
|
||||||
end sub
|
end sub
|
||||||
|
|
||||||
sub setPoster()
|
sub setPoster()
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<component name="ChannelData" extends="ContentNode">
|
<component name="ChannelData" extends="JFContentItem">
|
||||||
<interface>
|
<interface>
|
||||||
<field id="id" type="string" />
|
<field id="channelID" type="string" />
|
||||||
<field id="title" type="string" />
|
<field id="Title" type="string" />
|
||||||
<field id="image" type="node" onChange="setPoster" />
|
|
||||||
<field id="posterURL" type="string" />
|
|
||||||
<field id="json" type="associativearray" onChange="setFields" />
|
|
||||||
</interface>
|
</interface>
|
||||||
<script type="text/brightscript" uri="ChannelData.brs" />
|
<script type="text/brightscript" uri="ChannelData.brs" />
|
||||||
|
<script type="text/brightscript" uri="pkg:/source/api/Image.brs" />
|
||||||
|
<script type="text/brightscript" uri="pkg:/source/api/baserequest.brs" />
|
||||||
|
<script type="text/brightscript" uri="pkg:/source/utils/config.brs" />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -18,7 +18,6 @@ sub setPoster()
|
||||||
else
|
else
|
||||||
|
|
||||||
if m.top.json.ImageTags.Primary <> invalid then
|
if m.top.json.ImageTags.Primary <> invalid then
|
||||||
|
|
||||||
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag" : m.top.json.ImageTags.Primary }
|
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag" : m.top.json.ImageTags.Primary }
|
||||||
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
|
m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams)
|
||||||
else if m.top.json.BackdropImageTags <> invalid then
|
else if m.top.json.BackdropImageTags <> invalid then
|
||||||
|
|
|
@ -113,7 +113,7 @@ sub Main()
|
||||||
group.visible = false
|
group.visible = false
|
||||||
|
|
||||||
m.overhang.title = selectedItem.title
|
m.overhang.title = selectedItem.title
|
||||||
group = CreateChannelList(selectedItem.Id)
|
group = CreateChannelList(selectedItem)
|
||||||
group.overhangTitle = selectedItem.title
|
group.overhangTitle = selectedItem.title
|
||||||
m.scene.appendChild(group)
|
m.scene.appendChild(group)
|
||||||
else if selectedItem.type = "Boxset" then
|
else if selectedItem.type = "Boxset" then
|
||||||
|
@ -180,6 +180,22 @@ sub Main()
|
||||||
ReportPlayback(group, "start")
|
ReportPlayback(group, "start")
|
||||||
m.overhang.visible = false
|
m.overhang.visible = false
|
||||||
end if
|
end if
|
||||||
|
else if selectedItem.type = "TvChannel" then
|
||||||
|
' play channel feed
|
||||||
|
print selectedItem
|
||||||
|
video_id = selectedItem.id
|
||||||
|
video = CreateVideoPlayerGroup(video_id)
|
||||||
|
if video <> invalid then
|
||||||
|
group.lastFocus = group.focusedChild
|
||||||
|
group.setFocus(false)
|
||||||
|
group.visible = false
|
||||||
|
group = video
|
||||||
|
m.scene.appendChild(group)
|
||||||
|
group.setFocus(true)
|
||||||
|
group.control = "play"
|
||||||
|
ReportPlayback(group, "start")
|
||||||
|
m.overhang.visible = false
|
||||||
|
end if
|
||||||
else
|
else
|
||||||
' TODO - switch on more node types
|
' TODO - switch on more node types
|
||||||
if selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView" then
|
if selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView" then
|
||||||
|
|
|
@ -317,55 +317,17 @@ function CreateCollectionDetailList(collectionId)
|
||||||
return group
|
return group
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function CreateChannelList(libraryItem)
|
||||||
|
group = CreateObject("roSGNode", "ItemGrid2")
|
||||||
|
print libraryItem
|
||||||
|
group.parentItem = libraryItem
|
||||||
|
' group = CreateObject("roSGNode", "Channels")
|
||||||
|
' group.id = libraryId
|
||||||
|
|
||||||
|
group.observeField("selectedItem", m.port)
|
||||||
|
|
||||||
function CreateChannelList(libraryId)
|
|
||||||
group = CreateObject("roSGNode", "Channels")
|
|
||||||
group.id = libraryId
|
|
||||||
|
|
||||||
group.observeField("channelSelected", m.port)
|
|
||||||
|
|
||||||
|
|
||||||
sidepanel = group.findNode("options")
|
sidepanel = group.findNode("options")
|
||||||
channel_options = [
|
|
||||||
{"title": "Sort Field",
|
|
||||||
"base_title": "Sort Field",
|
|
||||||
"key": "channel_sort_field",
|
|
||||||
"default": "Name",
|
|
||||||
"values": [
|
|
||||||
{display: tr("Name"), value: "SortName"}
|
|
||||||
]},
|
|
||||||
{"title": "Sort Order",
|
|
||||||
"base_title": "Sort Order",
|
|
||||||
"key": "channel_sort_order",
|
|
||||||
"default": "Ascending",
|
|
||||||
"values": [
|
|
||||||
{display: tr("Descending"), value: "Descending"},
|
|
||||||
{display: tr("Ascending"), value: "Ascending"}
|
|
||||||
]}
|
|
||||||
]
|
|
||||||
new_options = []
|
|
||||||
for each opt in channel_options
|
|
||||||
o = CreateObject("roSGNode", "OptionsData")
|
|
||||||
o.title = tr(opt.title)
|
|
||||||
o.choices = opt.values
|
|
||||||
o.base_title = tr(opt.base_title)
|
|
||||||
o.config_key = opt.key
|
|
||||||
o.value = get_user_setting(opt.key, opt.default)
|
|
||||||
new_options.append([o])
|
|
||||||
end for
|
|
||||||
|
|
||||||
sidepanel.options = new_options
|
|
||||||
sidepanel.observeField("closeSidePanel", m.port)
|
|
||||||
|
|
||||||
p = CreatePaginator()
|
|
||||||
group.appendChild(p)
|
|
||||||
|
|
||||||
group.pageNumber = 1
|
|
||||||
p.currentPage = group.pageNumber
|
|
||||||
|
|
||||||
ChannelLister(group, m.page_size)
|
|
||||||
|
|
||||||
return group
|
return group
|
||||||
end function
|
end function
|
||||||
|
|
|
@ -149,6 +149,7 @@ function getTranscodeParameters(meta as object)
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
print meta.json.MediaStreams
|
||||||
streamInfo = { Codec: meta.json.MediaStreams[0].codec }
|
streamInfo = { Codec: meta.json.MediaStreams[0].codec }
|
||||||
if meta.json.MediaStreams[0].Profile <> invalid and meta.json.MediaStreams[0].Profile.len() > 0 then
|
if meta.json.MediaStreams[0].Profile <> invalid and meta.json.MediaStreams[0].Profile.len() > 0 then
|
||||||
streamInfo.Profile = LCase(meta.json.MediaStreams[0].Profile)
|
streamInfo.Profile = LCase(meta.json.MediaStreams[0].Profile)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user