Developing Channel using JSON

@hatton33 said:
So close now. The only bit i seem to be failing on right now is getting this thing to appear as an option in the channel itself. I was hoping that by doing what I’m doing, it would appear in the list but it seems not. Any pointers for what i’m missing.

In case you’re not, make sure to utilize Plex Framework Log function and watch the log files as you use the channel. This will give you insight into where a problem may be.

Another issue, be careful to not reuse the same naming convention where applicable. i.e. if a variable is defined higher in the program and then later you set a new value to the old variable, then it will be replaced. This is fine if you want that behavior.

So, it looks like the ListItems function needs the items_dict variable (which I am assuming is a list of dictionary values aka [{'title': 'example title1'}, {'title': 'example title2'}]) and the group variable (which seems to be a string). In the code you added, you append the group name to the groups_list but don’t update the items_dict with your new information. I’m guessing that’s why you are not seeing it when you selected the new Todays Live EPL Fixtures.

Since the items_dict is a list of dictionary items, you should be able to append the new dict to the list. The items_dict includes the 'order' so you will need to add that as well, I guess, depending on what the ListItems function needs.

Edit: for testing purposes I would add HTTP.CacheTime = 0 within the Start function. This will force Plex to Call ever URL and @route within the channel each time it is used. That way you’re not having to clear Plex’s cache to see your coding changes.

Also Plex Web is horrid for testing, because of caching issues. If the channel give an error and says something like “No soup” or whatever is says, then even after you update the code the Plex Web interface will still use the old cached response and give you the same error. So instead set cache time to 0. This will solve that issue, but only after the browser session has cleared its cache as well.

Bottom line, set cache to 0 and test with a mobile app or some other client other than Plex Web. Then when the time comes to release your code, make sure to remove the 0 cache time or change it to something more meaningful, i.e. an hour or 12 hours or 24 hours or whatever you decide. If you remove it then Plex Framework will use it’s default, which I don’t remember right now but is a long time and bad for debugging code.