Merge pull request #414 from neilsb/lazyman-fixes

Add Channel Support
This commit is contained in:
Anthony Lavado 2021-04-10 21:30:36 -04:00 committed by GitHub
commit d0f28f7fbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 9 deletions

View File

@ -64,7 +64,7 @@ sub loadInitialItems()
showTvGuid() showTvGuid()
end if end if
else if m.top.parentItem.collectionType = "CollectionFolder" OR m.top.parentItem.collectionType = "boxsets" then else if m.top.parentItem.collectionType = "CollectionFolder" OR m.top.parentItem.collectionType = "boxsets" or m.top.parentItem.Type = "Folder" or m.top.parentItem.Type = "Channel" then
' Non-recursive, to not show subfolder contents ' Non-recursive, to not show subfolder contents
m.loadItemsTask.recursive = false m.loadItemsTask.recursive = false
else if m.top.parentItem.collectionType = "Channel" then else if m.top.parentItem.collectionType = "Channel" then

View File

@ -59,7 +59,7 @@ sub loadItems()
tmp = CreateObject("roSGNode", "CollectionData") tmp = CreateObject("roSGNode", "CollectionData")
else if item.Type = "TvChannel" then else if item.Type = "TvChannel" then
tmp = CreateObject("roSGNode", "ChannelData") tmp = CreateObject("roSGNode", "ChannelData")
else if item.Type = "Folder" then else if item.Type = "Folder" or item.Type = "ChannelFolderItem" then
tmp = CreateObject("roSGNode", "FolderData") tmp = CreateObject("roSGNode", "FolderData")
else if item.Type = "Video" then else if item.Type = "Video" then
tmp = CreateObject("roSGNode", "VideoData") tmp = CreateObject("roSGNode", "VideoData")

View File

@ -31,16 +31,18 @@ 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[0] <> invalid then
imgParams = { "maxHeight": 440, "Tag" : m.top.json.BackdropImageTags[0] } imgParams = { "maxHeight": 440, "Tag" : m.top.json.BackdropImageTags[0] }
m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams) m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
else if m.top.json.ParentThumbImageTag <> invalid and m.top.json.ParentThumbItemId <> invalid then
imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag" : m.top.json.ParentThumbImageTag }
m.top.posterURL = ImageURL(m.top.json.ParentThumbItemId, "Thumb", imgParams)
end if end if
' Add Backdrop Image ' Add Backdrop Image
if m.top.json.BackdropImageTags <> invalid then if m.top.json.BackdropImageTags[0] <> invalid then
imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag" : m.top.json.BackdropImageTags[0] } imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag" : m.top.json.BackdropImageTags[0] }
m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams) m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if end if

View File

@ -60,6 +60,12 @@ sub itemContentChanged()
if itemData.genres.count() > 0 if itemData.genres.count() > 0
setFieldText("genres", tr("Genres") + ": " + itemData.genres.join(", ")) setFieldText("genres", tr("Genres") + ": " + itemData.genres.join(", "))
end if end if
' show tags if there are no genres to display
if itemData.genres.count() = 0 and itemData.tags.count() > 0
setFieldText("genres", tr("Tags") + ": " + itemData.tags.join(", "))
end if
director = invalid director = invalid
for each person in itemData.people for each person in itemData.people
if person.type = "Director" if person.type = "Director"
@ -70,8 +76,13 @@ sub itemContentChanged()
if director <> invalid if director <> invalid
setFieldText("director", tr("Director") + ": " + director) setFieldText("director", tr("Director") + ": " + director)
end if end if
setFieldText("video_codec", tr("Video") + ": " + itemData.mediaStreams[0].displayTitle)
setFieldText("audio_codec", tr("Audio") + ": " + itemData.mediaStreams[m.top.selectedAudioStreamIndex].displayTitle) if itemData.mediaStreams[0] <> invalid
setFieldText("video_codec", tr("Video") + ": " + itemData.mediaStreams[0].displayTitle)
end if
if itemData.mediaStreams[m.top.selectedAudioStreamIndex] <> invalid
setFieldText("audio_codec", tr("Audio") + ": " + itemData.mediaStreams[m.top.selectedAudioStreamIndex].displayTitle)
end if
' TODO - cmon now. these are buttons, not words ' TODO - cmon now. these are buttons, not words
if itemData.taglines.count() > 0 if itemData.taglines.count() > 0
setFieldText("tagline", itemData.taglines[0]) setFieldText("tagline", itemData.taglines[0])

View File

@ -103,7 +103,7 @@ sub Main()
else if isNodeEvent(msg, "selectedItem") else if isNodeEvent(msg, "selectedItem")
' If you select a library from ANYWHERE, follow this flow ' If you select a library from ANYWHERE, follow this flow
selectedItem = msg.getData() selectedItem = msg.getData()
if selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView" OR selectedItem.type = "Folder" if selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView" OR selectedItem.type = "Folder" OR selectedItem.type = "Channel"
group.lastFocus = group.focusedChild group.lastFocus = group.focusedChild
group.setFocus(false) group.setFocus(false)
group.visible = false group.visible = false