Conforming search query to Roku JSON format

I am trying to adapt my recipe files to read and parse my Roku JSON feed file. There are no categories in my feed. I have it divided into series/seasons/episodes as in the following example:

{
  "lastUpdated": "2023-06-30T11:55:24+00:00",
  "providerName": "Nation Extreme Wrestling",
  "language": "en-US",
  "series": [
    {
      "id": "db771e79bbcf433cb3b417865abf6cde",
      "title": "Nation Extreme Wrestling",
      "seasons": [
        {
          "seasonNumber": 1,
          "title": "NEW 1",
          "episodes": [
            {
              "id": "ead12e119ec74af78de702aee7131fe2",
              "title": "Travis Williams vs Judas Icarus",
              "content": {
                "dateAdded": "2023-06-19T14:26:56+00:00",
                "videos": [
                  {
                    "url": "https://d2n971lt6fos4i.cloudfront.net/NEW+1/Travis_Williams_vs_Judas_Icarus_(S1-EP1)/master.m3u8",
                    "quality": "FHD",
                    "videoType": "hls"
                  }
                ],
                "duration": 904,
                "language": "en-US"
              },
              "thumbnail": "https://d2n971lt6fos4i.cloudfront.net/NEW+1/Travis_Williams_vs_Judas_Icarus_(S1-EP1)/Travis+Williams+vs+Judas+Icarus+(S1-EP1).png",
              "episodeNumber": 1,
              "releaseDate": "2023-07-04",
              "shortDescription": "Golden Boy takes it to Judas Icarus",
              "longDescription": "These guys have been at it many times before, but tonight Travis is going to prove he is going to the top and he's one of the true players in the Pacific Northwest",
              "credits": [
                {
                  "name": "Travis Williams",
                  "role": "",
                  "birthDate": ""
                },
                {
                  "name": "Judas Icarus",
                  "role": "",
                  "birthDate": ""
                }
              ],
              "rating": {
                "rating": "TVPG",
                "ratingSource": "USA_PR"
              }
            },

This is how I have written the categories recipe:

{
  "cooker": "DynamicParser",
  "format": "json",
  "model": "com.amazon.android.model.content.ContentContainer",
  "translator": "ContentContainerTranslator",
  "modelType": "array",
  "query": "$..series[*]",
  "queryResultType": "[]$",
  "matchList": [
    "StringKey@mName"
  ],
  "keyDataType": "StringKey@keyDataPath"
}

This is how I have written the content recipe file:

{
  "cooker": "DynamicParser",
  "format": "json",
  "model": "com.amazon.android.model.content.Content",
  "translator": "ContentTranslator",
  "modelType": "array",
  "query": "$[?(@.series[0] in [$$par0$$])]",
  "matchList": [
    "seasons/episodes/title@mTitle",
    "seasons/episodes/id@mId",
    "seasons/episodes/longDescription@mDescription",
    "seasons/episodes/content/videos/url@mUrl",
    "seasons/episodes/thumbnail@mCardImageUrl",
    "seasons/episodes/thumbnail@mBackgroundImageUrl"
  ]
}

I am using the same JSON url I use for Roku so I know the urlFile is correct, but I keep getting service not available error on loading the app on my test device. Where am I going wrong? Is the syntax incorrect? Have I interpreted the JSON schema correctly? New to this, so hopefully it isn’t a glaring mistake. Looking for any suggestions to correct this.

Hi Gaalen,

Welcome to the Forums, and thank you for posting! Could you please specify, which Amazon SDK / service you are using – is it Amazon Creator by any chance? We need more details to be able to assist you better. Thanks!

1 Like

Hello,

Thanks for responding! I am using Android Studio (Iguana) to build the Fire TV app on the Fire App Builder template. Is that what you needed to know?

1 Like