question

Apps2018 avatar image
Apps2018 asked

How to classify the videos in your corresponding playlist?

Hello!! It is the first time that I make an App with Amazon, specifically I am creating an App with Fire App Builder, my device is an Amazon Fire TV Stick. I have my JSON: https://api.familyes.com/channels/156 and I can make it look in my application, but all the videos are repeated in all the categories, that is, it does not classify the videos by their category.

This is the code of CategoriesRecipe.json:

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

And my ContentsRecipe.json, which is where I think I do not do things right, I do not know what to put in the query to classify each video in your playlist.

{
  "cooker": "DynamicParser",
  "format": "json",
  "model": "com.amazon.android.model.content.Content",
  "translator": "ContentTranslator",
  "modelType": "array",
  "query": "$..videos.*",
  "matchList": [
    "title@mTitle",
    "id@mId",
    "description@mDescription",
    "video_url@mUrl",
    "thumbnail@mCardImageUrl",
    "thumbnail@mBackgroundImageUrl",
    "channel_id@mChannelId"
  ]
}

What am I doing wrong?

I hope someone can help me, thanks!

fire tvdebuggingandroidfire app builderdeveloper portal
2 comments
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi there,

Could you please provide a sample feed you plan to use with Fire App Builder and the exact structure you are looking for? Meaning, how you would like your content to presented with Fire App Builder. Thanks!

0 Likes 0 ·

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi Apps2018,

It looks like your ContentsRecipe.json is just incorrectly querying for the Category. We updated the query in the ContentsRecipe.json and it seemed to fix the issue.

 
{
  "cooker": "DynamicParser",
  "format": "json",
  "model": "com.amazon.android.model.content.Content",
  "translator": "ContentTranslator",
  "modelType": "array",
  "query": "$..playlists[?(@.title == '$par0$')].videos.*",
  "matchList": [
    "title@mTitle",
    "id@mId",
    "description@mDescription",
    "video_url@mUrl",
    "thumbnail@mCardImageUrl",
    "thumbnail@mBackgroundImageUrl",
    "channel_id@mChannelId"
  ]
}
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.