diff --git a/components/ItemGrid2/GridItem.brs b/components/ItemGrid2/GridItem.brs index fcbea87b..504e1ea8 100644 --- a/components/ItemGrid2/GridItem.brs +++ b/components/ItemGrid2/GridItem.brs @@ -40,6 +40,9 @@ sub itemContentChanged() else if itemData.type = "TvChannel" then m.itemPoster.uri = itemData.PosterUrl m.itemText.text = itemData.Title + else if itemData.type = "Video" then + m.itemPoster.uri = itemData.PosterUrl + m.itemText.text = itemData.Title else print "Unhandled Item Type: " + itemData.type end if diff --git a/components/ItemGrid2/ItemGrid2.brs b/components/ItemGrid2/ItemGrid2.brs index ab7990b1..1dd3dd17 100644 --- a/components/ItemGrid2/ItemGrid2.brs +++ b/components/ItemGrid2/ItemGrid2.brs @@ -59,6 +59,8 @@ sub loadInitialItems() 'For LiveTV, we want to "Fit" the item images, not zoom m.top.imageDisplayMode = "scaleToFit" + else if m.top.parentItem.collectionType = "Channel" then + m.top.imageDisplayMode = "scaleToFit" else print "Unknown Type: " m.top.parentItem end if @@ -111,7 +113,11 @@ sub SetUpOptions() options.sort = [ { "Title": tr("TITLE"), "Name": "SortName" } ] - + else + options.views = [{"Title": tr("Default"), "Name": "default" }] + options.sort = [ + { "Title": tr("TITLE"), "Name": "SortName" } + ] end if for each o in options.sort diff --git a/components/ItemGrid2/LoadItemsTask2.brs b/components/ItemGrid2/LoadItemsTask2.brs index 74b884d8..4b1485d4 100644 --- a/components/ItemGrid2/LoadItemsTask2.brs +++ b/components/ItemGrid2/LoadItemsTask2.brs @@ -59,6 +59,8 @@ sub loadItems() tmp = CreateObject("roSGNode", "CollectionData") else if item.Type = "TvChannel" then tmp = CreateObject("roSGNode", "ChannelData") + else if item.Type = "Video" then + tmp = CreateObject("roSGNode", "VideoData") else print "Unknown Type: " item.Type end if diff --git a/components/data/HomeData.brs b/components/data/HomeData.brs index 2a1fced0..318f06ac 100644 --- a/components/data/HomeData.brs +++ b/components/data/HomeData.brs @@ -138,9 +138,11 @@ sub setData() m.top.widePosterUrl = m.top.thumbnailURL m.top.posterUrl = m.top.thumbnailURL - else if datum.type = "TvChannel" OR datum.type = "UserView" then - m.top.widePosterUrl = "pkg:/images/baseline_live_tv_white_48dp.png" - + else if datum.type = "TvChannel" OR datum.type = "Channel" then + params = { "Tag" : datum.ImageTags.Primary, "maxHeight" : 261, "maxWidth" : 464 } + m.top.thumbnailURL = ImageURL(datum.id, "Primary", params) + m.top.widePosterUrl = m.top.thumbnailURL + m.top.iconUrl = "pkg:/images/baseline_live_tv_white_48dp.png" end if end sub \ No newline at end of file diff --git a/components/data/VideoData.brs b/components/data/VideoData.brs index b3963a13..2fae0d4b 100644 --- a/components/data/VideoData.brs +++ b/components/data/VideoData.brs @@ -1,16 +1,21 @@ sub setFields() - datum = m.top.json + json = m.top.json - m.top.id = datum.id - m.top.title = datum.name + m.top.id = json.id + m.top.Title = json.name + m.top.Description = json.overview + m.top.favorite = json.UserData.isFavorite + m.top.watched = json.UserData.played + m.top.Type = "Video" + setPoster() end sub sub setPoster() if m.top.image <> invalid m.top.posterURL = m.top.image.url - else - m.top.posterURL = "" + else if m.top.json.ImageTags.Primary <> invalid then + imgParams = { "maxHeight": 440, "maxWidth": 295, "Tag": m.top.json.ImageTags.Primary } + m.top.posterURL = ImageURL(m.top.json.id, "Primary", imgParams) end if - -end sub +end sub \ No newline at end of file diff --git a/components/data/VideoData.xml b/components/data/VideoData.xml index 403a7c1b..7e2a24a6 100644 --- a/components/data/VideoData.xml +++ b/components/data/VideoData.xml @@ -1,11 +1,7 @@ - - - - - - - - +