From eea189bd97054ae9d3651819853e775f3ca13ea7 Mon Sep 17 00:00:00 2001 From: Neil Burrows Date: Mon, 15 Jun 2020 17:05:48 +0100 Subject: [PATCH] Implement new ItemGrid for TV Shows --- components/ItemGrid2/GridItem.brs | 4 ++ components/ItemGrid2/ItemGrid2.brs | 11 ++++- components/ItemGrid2/ItemGrid2.xml | 2 +- components/ItemGrid2/LoadItemsTask2.brs | 2 + components/data/MovieData.brs | 2 - components/data/SeriesData.brs | 54 +++++++++++++++++++------ components/data/SeriesData.xml | 9 ++--- source/Main.brs | 4 +- source/ShowScenes.brs | 20 ++++----- 9 files changed, 71 insertions(+), 37 deletions(-) diff --git a/components/ItemGrid2/GridItem.brs b/components/ItemGrid2/GridItem.brs index c857f3906..f5bfbac3a 100644 --- a/components/ItemGrid2/GridItem.brs +++ b/components/ItemGrid2/GridItem.brs @@ -15,6 +15,10 @@ sub itemContentChanged() itemPoster.uri = itemData.PosterUrl m.itemText.text = itemData.Title return + else if itemData.type = "Series" then + itemPoster.uri = itemData.PosterUrl + m.itemText.text = itemData.Title + return end if print "Unhandled Item Type: " + itemData.type diff --git a/components/ItemGrid2/ItemGrid2.brs b/components/ItemGrid2/ItemGrid2.brs index cc78bb3fc..25d3cbdc6 100644 --- a/components/ItemGrid2/ItemGrid2.brs +++ b/components/ItemGrid2/ItemGrid2.brs @@ -29,9 +29,16 @@ end sub ' 'Load initial set of Data sub loadInitialItems() - m.loadItemsTask.itemId = m.top.itemId + + m.loadItemsTask.itemId = m.top.parentItem.Id m.loadItemsTask.observeField("content", "ItemDataLoaded") - m.loadItemsTask.itemType = "Movie" + + if m.top.parentItem.collectionType = "movies" then + m.loadItemsTask.itemType = "Movie" + else if m.top.parentItem.collectionType = "tvshows" then + m.loadItemsTask.itemType = "Series" + end if + m.loadItemsTask.control = "RUN" end sub diff --git a/components/ItemGrid2/ItemGrid2.xml b/components/ItemGrid2/ItemGrid2.xml index 9070f7cd5..dc6064400 100644 --- a/components/ItemGrid2/ItemGrid2.xml +++ b/components/ItemGrid2/ItemGrid2.xml @@ -30,7 +30,7 @@ - +