private static void LoadArtist(Artist artist)
        {
            Write("Thanks, we're loading the songs for this artist:", true);
            Write(artist.Name);
            Write($"Country: {artist.Country}");
            Write($"Years: {artist.Lifespan?.BeginYear} - {artist.Lifespan?.EndYear}", true);

            Write("This might take a while, please be patient...");
            _spinner.Start();
            var albums = _musicService.GetAlbums(artist).Result;

            _spinner.Stop();

            var allSongs = albums.Where(a => a.Songs != null && a.Songs.Any()).SelectMany(a => a.Songs);

            Success($"We found {albums.Count()} albums containing {allSongs.Count()} songs. Want to see the list?");
            var showSongList = GetString("Type 'y' for yes, 'n' for no", new List <string> {
                "y", "n"
            });

            if (showSongList == "y")
            {
                DisplayAlbums(albums);
            }

            Write("");
            Write("OK, are you ready to look up the lyrics for this artist? This can take a LONG time, so go make a cuppa when you've started this. Press 'enter' to start:");
            Console.ReadLine();
            FetchLyrics(artist, allSongs);

            Write("");
            Write("We've fetched all the lyrics we can, we can now generate stats. Press 'enter' to start calculation:");
            Console.ReadLine();
            CalculateStats(artist);
        }
Beispiel #2
0
 public IEnumerable <MusicAlbum> GetAlbums()
 {
     return(_musicService.GetAlbums());
 }