Series/Episode categorization with the RDP-To-Scenegraph example
After a lot of digging and experimentation, I think I have discovered how to implement category names with episodes and seasons along with generic movie/short form video category names on the RDP-to-Scenegraph master zip, available at this GIT location: https://github.com/rokudev/rdp-to-scenegraph-channel-template
First off, thank you to 37mediagroup for the nudge in the right direction for updating the Components/Content/RootHandler.brs file. That is necessary in part, but I want to help break it down futher for others looking for episodes and season categories..
Line 100 of the RootHandler needs to have the category names you have defined in your JSON file. These are the names that you will see displayed on the channel and should be names as such. For example, mine has the following:
if item = "series" or item = "Cornhole Series" or item = "Sports Talk"
...then my JSON file will have the above names as the names with content that used to be a single "series" entry. As an example, what used to just be the "series" entry with different named series...
"providerName": ...,
"lastUpdated": ...,
"language": ...,
"series": [
{
"id" ....,
"title" "Cornhole Series"
...
},
{
"id" ....,
"title" "Sports Talk"
...
}
]
can now be seen as:
"providerName": ...,
"lastUpdated": ...,
"language": ...,
"Cornhole Series": [
{
"id" ....,
"title" "Cornhole Series"
...
}
],
"Sports Talk" : [
{
"id" ....,
"title" "Sports Talk"
...
}
]
I have pulled each of my series out of the categorized "series" entry, and labeled the series as such for my own named listings.
... and then for the "movies" or short form videos, I have done a similar set up as above, and used the category names I want have shown in place of "movies" and then added additional entries after each open brace as such:
"Example 1": [
{ ... movie one in a certain category here ... },
{ ... second in a series of movies in a category here ... } ,
{ ... third movie here ... }
],
"Example 2": [
{ ... different category movie 1 here ... },
{ ... different category movie 2 here ... },
{ ... third movie here ... }
],
"Example 3": [
{ ... last category movie 1 here ... },
{ ... last category movie 2 here ... }
]
The above examples allows you to place single categoriezed series in a row. I have a handful of different shows on my channel, and many of them can be grouped together in like categories (self defence, sport recap talk show, live high school sports... all under "Sports"
Now... If you want a row of all of your different series to display, so you see a series on a travevl show, next to a series on a sporting show, etc, you can use the existing "series" entry in the JSON like we always have. However, to change it to someting a little more user friendly like "Our Series" or "Original Features" etc, you have to alter it in the RootHandler line 138 from this:
rowAA = {
title: item
children: children
}
to this:
if item = "series"
rowAA = {
title: "Original Series" ' <-- you can enter your own name here
children: children
}
else
rowAA = {
title: item
children: children
}
Now here is where things get fun. Starting on line 24 in the DetailsViewLogic.brs file, you will see the following code:
sub OnDetailsContentSet(event as Object)
btnsContent = CreateObject("roSGNode", "ContentNode")
if event.GetData().TITLE = "series"
btnsContent.Update({ children: [{ title: "Episodes", id: "episodes" }] })
else
btnsContent.Update({ children: [{ title: "Play", id: "play" }] })
end if
This is the code you will update to include your original named series files in your JSON. So using my example above, I would add into this section a few lines of code so tha tmine would show like this:
sub OnDetailsContentSet(event as Object)
btnsContent = CreateObject("roSGNode", "ContentNode")
if event.GetData().TITLE = "series"
btnsContent.Update({ children: [{ title: "Episodes", id: "episodes" }] })
elseif event.GetData().TITLE = "Original Series"
btnsContent.Update({ children: [{ title: "Episodes", id: "episodes" }] })
elseif event.GetData().TITLE = "Sports Talk"
btnsContent.Update({ children: [{ title: "Episodes", id: "episodes" }] })
elseif event.GetData().TITLE = "Cornhole Series"
btnsContent.Update({ children: [{ title: "Episodes", id: "episodes" }] })
else
btnsContent.Update({ children: [{ title: "Play", id: "play" }] })
end if
I've included the "Original Series" title here as well as that is what I renamed my "series" row to on line 138 in the RootHandler.brs file
With the above I have done the following:
- Renamed "series" to "Original Series" as the row title on my channel, and allowed for all of those series to correctly function wiht the seasons/episodes.
- Added original categories of series under the names "Sports Talk" and "Cornhole Series" so that i will see only those categoried programs on that row, and they too have the season/episode funtionality
- Added original categories for single movie and single episode content based on my JSON feed.