parse static method
Implementation
static AlbumFull parse(dynamic data, String albumId) {
final albumBasic = AlbumBasic(
albumId: albumId,
name: traverseString(data, ["tabs", "title", "text"]) ?? '',
);
final artistData = traverse(data, ["tabs", "straplineTextOne", "runs"]);
final artistBasic = ArtistBasic(
artistId: traverseString(artistData, ["browseId"]),
name: traverseString(artistData, ["text"]) ?? '',
);
final thumbnails = traverseList(data, ["background", "thumbnails"])
.map((item) => ThumbnailFull.fromMap(item))
.toList();
return AlbumFull(
name: albumBasic.name,
type: "ALBUM",
albumId: albumId,
playlistId:
traverseString(data, ["musicPlayButtonRenderer", "playlistId"]) ?? '',
artist: artistBasic,
year: processYear(
traverseList(data, ["tabs", "subtitle", "text"]).last,
),
thumbnails: thumbnails,
songs: traverseList(data, ["musicResponsiveListItemRenderer"])
.map(
(item) => SongParser.parseAlbumSong(
item,
artistBasic,
albumBasic,
thumbnails,
),
)
.toList(),
);
}