fire-app-builder icon indicating copy to clipboard operation
fire-app-builder copied to clipboard

Fire App fails with only 1 HLS item in the feed list

Open Chanepic opened this issue 6 years ago • 2 comments

Leaving this here as we have gotten little to no response in the Amazon developer forums.

We are a broadcast entity and sometimes we only have 1 live video playing and but FireApp Builder will not show any other feed item if only one exists in the live feed. History of Support forum engagement: https://forums.developer.amazon.com/questions/181328/fireapp-builder-with-only-1-live-hls-video-in-the.html

We've been told the bug has been fixed but not deployed yet. When will this bug fix be pushed? Thanks

Chanepic avatar Nov 06 '18 16:11 Chanepic

In the meantime, before the changes are released, please try replacing these lines referenced here https://github.com/amzn/fire-app-builder/blob/master/DynamicParser/src/main/java/com/amazon/dynamicparser/DynamicParser.java#L483-L486

To the following code snippet:

Object queryResult = getParserImpl(parserType).parseWithQuery(input, query);

// Because XML Feeds are dynamically structured, some fields can be single or multiple.
// XML Parser will return single objects as a Map and multiple objects as an Array.
// We need to account for the case where we expect an Array but get a Map instead.
if (queryResult != null && queryResultType == ArrayList.class
        && queryResult instanceof HashMap) {
    Log.d(TAG, "Casting HashMap into ArrayList");

    ArrayList<Object> newResult = new ArrayList<>();
    newResult.add(queryResult);

    queryResult = newResult;
}

// Parse the data and cast it to the expected result type.
Object parseResult = queryResultType.cast(queryResult);

I’m not quite sure if this will solve your issue because you filed a lot of issues and we may have fixed some but it still hasn’t been released yet. Please give it a try and let us know if that works for you for now. Thanks!

levonlevonian avatar Nov 09 '18 18:11 levonlevonian

In the meantime, before the changes are released, please try replacing these lines referenced here https://github.com/amzn/fire-app-builder/blob/master/DynamicParser/src/main/java/com/amazon/dynamicparser/DynamicParser.java#L483-L486

To the following code snippet:

Object queryResult = getParserImpl(parserType).parseWithQuery(input, query);

// Because XML Feeds are dynamically structured, some fields can be single or multiple.
// XML Parser will return single objects as a Map and multiple objects as an Array.
// We need to account for the case where we expect an Array but get a Map instead.
if (queryResult != null && queryResultType == ArrayList.class
        && queryResult instanceof HashMap) {
    Log.d(TAG, "Casting HashMap into ArrayList");

    ArrayList<Object> newResult = new ArrayList<>();
    newResult.add(queryResult);

    queryResult = newResult;
}

// Parse the data and cast it to the expected result type.
Object parseResult = queryResultType.cast(queryResult);

I’m not quite sure if this will solve your issue because you filed a lot of issues and we may have fixed some but it still hasn’t been released yet. Please give it a try and let us know if that works for you for now. Thanks!

Levon, Thanks a ton and I will give this a shot and report back ASAP. Best

Chanepic avatar Nov 13 '18 17:11 Chanepic