parseHomeSection static method

PlaylistDetailed parseHomeSection(
  1. dynamic item
)

Implementation

static PlaylistDetailed parseHomeSection(dynamic item) {
  final artist = traverse(item, ["subtitle", "runs"]);

  return PlaylistDetailed(
    type: "PLAYLIST",
    playlistId:
        traverseString(item, ["navigationEndpoint", "playlistId"]) ?? '',
    name: traverseString(item, ["runs", "text"]) ?? '',
    artist: ArtistBasic(
      name: traverseString(artist, ["text"]) ?? '',
      artistId: traverseString(artist, ["browseId"]),
    ),
    thumbnails: traverseList(item, ["thumbnails"])
        .map((item) => ThumbnailFull.fromMap(item))
        .toList(),
  );
}