예제 #1
0
        public static ArtistPlaylists FromMusicCarouselShelfRenderer(MusicCarouselShelfRenderer renderer)
        {
            ArtistPlaylists playlists = new ArtistPlaylists();

            foreach (var content in renderer.Contents)
            {
                playlists.Playlists.Add(ArtistPlaylist.FromMusicTwoRowItemRenderer(content.MusicTwoRowItemRenderer));
            }

            return(playlists);
        }
예제 #2
0
        public static ArtistPlaylist FromMusicTwoRowItemRenderer(MusicTwoRowItemRenderer renderer)
        {
            ArtistPlaylist playlist = new ArtistPlaylist();

            playlist.Thumbnails = renderer.ThumbnailRenderer.MusicThumbnailRenderer.Thumbnail.Thumbnails;

            playlist.Title = renderer.Title.Runs[0].Text;

            playlist.BrowseId = renderer.Title.Runs[0].NavigationEndpoint.BrowseEndpoint.BrowseId;

            if (renderer.Subtitle != null && renderer.Subtitle.Runs.Count >= 3)
            {
                playlist.Author = renderer.Subtitle.Runs[2].Text;
            }

            return(playlist);
        }