Пример #1
0
        public IEnumerable <string> GetText(string parameter)
        {
            if (string.IsNullOrEmpty(parameter))
            {
                return(new List <string> {
                    "Username not provided. Use -help/-h for more info"
                });
            }

            var playlists = PlaylistsWrapper.GetUsersPlaylists(parameter);

            return(playlists.Select(x => x.Name));
        }
Пример #2
0
        private static void DisplayUserPlaylists(string username)
        {
            var playlists = PlaylistsWrapper.GetUsersPlaylists(username);

            foreach (var playlist in playlists)
            {
                WriteLine(playlist.Name);
                var songs = PlaylistsWrapper.GetSongsFromPlaylist(username, playlist.Id);
                foreach (var song in songs)
                {
                    WriteLine($"\t{string.Join("&", song.Artists.Select(x => x.Name))} - {song.Name}");
                }
            }
        }