parseTrendingItem function
- JsonMap data
Parses the trending item
Implementation
JsonMap parseTrendingItem(JsonMap data) {
final videoType = nav(data, [
...PLAY_BUTTON,
'playNavigationEndpoint',
...NAVIGATION_VIDEO_TYPE,
]);
if (videoType == 'MUSIC_VIDEO_TYPE_PODCAST_EPISODE') {
return parseEpisodeFlat(data);
}
return parseSongFlat(data, withPlaylistId: true);
}