public async Task GetPopularSongs()
        {
            var playlists = await _playlistSearchClient.GetPlaylists("top popular hits", 1);

            playlists.Shuffle();

            PopularPlaylistResults       = new ObservableCollection <PlaylistObject>(playlists.Select(x => new PlaylistObject(x.getId(), x.getThumbnail(), x.getTitle(), x.getUrl(), $"{x.getVideoCount()} songs")));
            PopularPlaylists.ItemsSource = PopularPlaylistResults;
        }
Exemplo n.º 2
0
        static async void Search_Playlist()
        {
            // Disable logging
            Log.setMode(false);

            // Keyword
            string querystring = "Bushido";

            // Number of result pages
            int querypages = 1;

            ////////////////////////////////
            // Start searching
            ////////////////////////////////

            PlaylistSearch playlist = new PlaylistSearch();
            var            items    = await playlist.GetPlaylists(querystring, querypages);

            foreach (var item in items)
            {
                Console.WriteLine("Id: " + item.getId());
                Console.WriteLine("Title: " + item.getTitle());
                Console.WriteLine("Author: " + item.getAuthor());
                Console.WriteLine("VideoCount: " + item.getVideoCount());
                Console.WriteLine("Thumbnail: " + item.getThumbnail());
                Console.WriteLine("Url: " + item.getUrl());
                Console.WriteLine("");
            }
        }