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 @@
-
+
diff --git a/components/ItemGrid2/LoadItemsTask2.brs b/components/ItemGrid2/LoadItemsTask2.brs
index 67533f736..f5afc5a29 100644
--- a/components/ItemGrid2/LoadItemsTask2.brs
+++ b/components/ItemGrid2/LoadItemsTask2.brs
@@ -36,6 +36,8 @@ sub loadItems()
tmp = invalid
if item.Type = "Movie" then
tmp = CreateObject("roSGNode", "MovieData")
+ else if item.Type = "Series" then
+ tmp = CreateObject("roSGNode", "SeriesData")
else
print "Unknown Type: " item.Type
diff --git a/components/data/MovieData.brs b/components/data/MovieData.brs
index 37df060e7..0079452c5 100644
--- a/components/data/MovieData.brs
+++ b/components/data/MovieData.brs
@@ -1,6 +1,4 @@
sub setFields()
-
-' print "Setting Fields in MovieData - " m.top.json.name
json = m.top.json
m.top.id = json.id
diff --git a/components/data/SeriesData.brs b/components/data/SeriesData.brs
index 9b34fe711..6edd75406 100644
--- a/components/data/SeriesData.brs
+++ b/components/data/SeriesData.brs
@@ -1,19 +1,49 @@
sub setFields()
- datum = m.top.json
- m.top.id = datum.id
- m.top.title = datum.name
- m.top.overview = datum.overview
+ json = m.top.json
- setPoster()
+ 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 = "Series"
+ m.top.overview = json.overview
+
+ if json.ProductionYear <> invalid then
+ m.top.SubTitle = json.ProductionYear
+ end if
- 'm.top.seasons = TVSeasons(datum.id)
- 'm.top.nextup = TVNext(datum.id)
+ if json.OfficialRating <> invalid and json.OfficialRating <> "" then
+ m.top.Rating = json.OfficialRating
+ if m.top.SubTitle <> "" then
+ m.top.SubTitle = m.top.SubTitle + " - " + m.top.Rating
+ else
+ m.top.SubTitle = m.top.Rating
+ end if
+ end if
+
+ setPoster()
end sub
sub setPoster()
- if m.top.image <> invalid
- m.top.posterURL = m.top.image.url
- else
- m.top.posterURL = ""
+ if m.top.image <> invalid
+ m.top.posterURL = m.top.image.url
+ 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)
+ else if m.top.json.BackdropImageTags <> invalid then
+ imgParams = { "maxHeight": 440, "Tag" : m.top.json.BackdropImageTags[0] }
+ m.top.posterURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
end if
-end sub
\ No newline at end of file
+
+ ' Add Backdrop Image
+ if m.top.json.BackdropImageTags <> invalid then
+ imgParams = { "maxHeight": 720, "maxWidth": 1280, "Tag" : m.top.json.BackdropImageTags[0] }
+ m.top.backdropURL = ImageURL(m.top.json.id, "Backdrop", imgParams)
+ end if
+
+ end if
+end sub
diff --git a/components/data/SeriesData.xml b/components/data/SeriesData.xml
index ebefd7b15..8effa24e3 100644
--- a/components/data/SeriesData.xml
+++ b/components/data/SeriesData.xml
@@ -1,15 +1,14 @@
-
+
-
-
-
-
+
+
+
diff --git a/source/Main.brs b/source/Main.brs
index 98dd21a90..739d8c1b0 100644
--- a/source/Main.brs
+++ b/source/Main.brs
@@ -82,7 +82,7 @@ sub Main()
group.setFocus(false)
group.visible = false
m.overhang.title = selectedItem.name
- group = CreateMovieListGroup(selectedItem.Id)
+ group = CreateMovieListGroup(selectedItem)
group.overhangTitle = selectedItem.name
m.scene.appendChild(group)
else if (selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView") AND selectedItem.collectionType = "tvshows"
@@ -91,7 +91,7 @@ sub Main()
group.visible = false
m.overhang.title = selectedItem.name
- group = CreateSeriesListGroup(selectedItem.Id)
+ group = CreateSeriesListGroup(selectedItem)
group.overhangTitle = selectedItem.name
m.scene.appendChild(group)
else if (selectedItem.type = "CollectionFolder" OR selectedItem.type = "UserView") AND selectedItem.collectionType = "boxsets"
diff --git a/source/ShowScenes.brs b/source/ShowScenes.brs
index e77211fc8..2bcbeca14 100644
--- a/source/ShowScenes.brs
+++ b/source/ShowScenes.brs
@@ -195,9 +195,9 @@ function CreateHomeGroup()
return group
end function
-function CreateMovieListGroup(libraryId)
+function CreateMovieListGroup(libraryItem)
group = CreateObject("roSGNode", "ItemGrid2")
- group.itemId = libraryId
+ group.parentItem = libraryItem
group.observeField("selectedItem", m.port)
@@ -252,20 +252,14 @@ function CreateMovieDetailsGroup(movie)
return group
end function
-function CreateSeriesListGroup(libraryId)
- group = CreateObject("roSGNode", "TVShows")
- group.id = libraryId
-
- group.observeField("seriesSelected", m.port)
+function CreateSeriesListGroup(libraryItem)
- sidepanel = group.findNode("options")
+ group = CreateObject("roSGNode", "ItemGrid2")
+ group.parentItem = libraryItem
- p = CreatePaginator()
- group.appendChild(p)
+ group.observeField("selectedItem", m.port)
- group.pageNumber = 1
- p.currentPage = group.pageNumber
- SeriesLister(group, m.page_size)
+ sidepanel = group.findNode("options")
return group
end function