Wrong information in producers array if there are no producers

Issue #90 resolved
sher afgan created an issue

Issue: The producer array in the anime API response is having an inappropiate value only when the producers data is missing from MAL. Filtering through that specific node links is right when the data is present, but if the data is not available MAL display "add some" link and the parser considers this a valid data.

Sample: https://api.atarashiiapp.com/2/anime/32448

Solution I am using.

$producers = [];
foreach($records as $rItem) {
    if($rItem->hasAttribute('title') && $rItem->nodeValue !== 'add more') {
        $producers[] = $rItem->nodeValue;
    }
}

Comments (2)

  1. Log in to comment