parseAlbumSong static method
SongDetailed
parseAlbumSong(
- dynamic item,
- ArtistBasic artistBasic,
- AlbumBasic albumBasic,
- List<
ThumbnailFull> thumbnails,
Implementation
static SongDetailed parseAlbumSong(
dynamic item,
ArtistBasic artistBasic,
AlbumBasic albumBasic,
List<ThumbnailFull> thumbnails,
) {
final title = traverseList(item, ["flexColumns", "runs"])
.firstWhere(isTitle, orElse: () => null);
final duration = traverseList(item, ["fixedColumns", "runs"])
.firstWhere(isDuration, orElse: () => null);
return SongDetailed(
type: "SONG",
videoId: traverseString(item, ["playlistItemData", "videoId"]) ?? '',
name: traverseString(title, ["text"]) ?? '',
artist: artistBasic,
album: albumBasic,
duration: Parser.parseDuration(duration?['text']),
thumbnails: thumbnails,
);
}