Roku Direct Publisher

Roku Direct Publisher - the easiest way to create a great TV experience. Learn more about how to create a Roku channel and share your experiences with others.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
phlume
Streaming Star

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.

dev-img2.jpg

 

dev-img1.jpg

 

0 Kudos
32 REPLIES 32
ferdiworks
Roku Guru

Re: Series/Episode categorization with the RDP-To-Scenegraph example

Thank you for taken the time to share your codes and structure, Nice job1 i my self like what you done and want to mtry and see if I can make something like this with one of my channels that uses a tvspecials category but pull episodes from playlist. I can only get one line of videos like most here and trying to figure how to pull the playlist categories. I want to try your method and see if this can work without having to change the whole json feed!

OnDemandTV
admin@ondemandtvnetworks.com
0 Kudos
ferdiworks
Roku Guru

Re: Series/Episode categorization with the RDP-To-Scenegraph example

It would of been nice to actually see your json feed file. I followed your process but failed as I got errors from the root handler file and I believe its because I am not understanding the feed file code process you done here. I think if we seen an actual sample we may have that ah ha moment.

OnDemandTV
admin@ondemandtvnetworks.com
0 Kudos
phlume
Streaming Star

Re: Series/Episode categorization with the RDP-To-Scenegraph example

I can appreciate that... And perhaps if you have other errors in your .brs files, you may want to review the full package. Here is a complete "sample channel" that is working with the feed file in the zip for you to review, edit, and upload where you see fit. If you simply upload the SampleChannel zip as it is, you will see the working channel shown below.

https://phlumestream.000webhostapp.com/RDP-to-SG-Example.zip

Also, should you just want to jump to the JSON that is linked within the above channel, that feed file is here for review:

https://phlumestream.000webhostapp.com/test-feed.json

 

Main PageMain Page

 

Series examplesSeries examples

 

Seasons page withinSeasons page within

 

ferdiworks
Roku Guru

Re: Series/Episode categorization with the RDP-To-Scenegraph example

Thank you for your kindness and help. I can see where I went wrong in my feed now, Its amazing how a character or two can throw you off LOL!

I appreciate your sample files too, Huge help!

OnDemandTV
admin@ondemandtvnetworks.com
0 Kudos
37mediagroup
Roku Guru

Re: Series/Episode categorization with the RDP-To-Scenegraph example

Thanks for the shoutout.  I'm not the best at a lot of this stuff, but I can come off the bench & knock down a couple 3's now & then to help out 😁 👍

0 Kudos
ferdiworks
Roku Guru

Re: Series/Episode categorization with the RDP-To-Scenegraph example

Download the zip and inside is a copy of the feed file along with the sample app!

https://phlumestream.000webhostapp.com/RDP-to-SG-Example.zip

OnDemandTV
admin@ondemandtvnetworks.com
0 Kudos
newchannel
Roku Guru

Re: Series/Episode categorization with the RDP-To-Scenegraph example

Thank you Phlume for providing such detailed information.

I have a DP channel I am converting and my json has categories and at the bottom of the json are playlists that use the content ID's of the content I wanted to display on each row. 

If I understand correctly, for each row of content aka "category" I want displayed, I have to go to the RootHandlerBRS line 100 and type a "if item =" for each row/category name that I want to see listed? Is this correct?

I wish there was a way for it to pull info from the playlists in the json so I don't have to rewrite the json feed. 

Regardless, I do appreciate what you have added to the forum. Going to see what I can do to get my channel converted over. 

Thank you.

http://www.victoryNOWfilmsandtv.com
0 Kudos
phlume
Streaming Star

Re: Series/Episode categorization with the RDP-To-Scenegraph example

@newchannelyes, in part. There is still more to do after adjusting line 100, but this is needed as well.

If you have a category names "Snakes" then you will need:

Line 100 (RootHandler):

if item = "snakes" ...

 In your JSON:

...
"Snakes": [
  {
  "id" ....,
  "title" "Snakes"
  ...
  }
],
...

In DetailsViewlogic.brs you need to adjust line 24 to include 'snakes':

...
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 = "Snakes"
    btnsContent.Update({ children: [{ title: "Episodes", id: "episodes" }] })
...
0 Kudos
newchannel
Roku Guru

Re: Series/Episode categorization with the RDP-To-Scenegraph example

Thank you again.

I was able to take my live stream and make it a category since there is the option of "liveFeeds" listed already in the RootHandler.

Next I will attempt to add my additional categories.

Plus, I need to change the order. The channel opens with series, shortform, movies and live and I need to look further to see how to move these around so that the live is first.

http://www.victoryNOWfilmsandtv.com
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.