Ejemplo n.º 1
0
        public override void Execute(IPlayer player, params string[] parameters)
        {
            if (parameters.Length == 1)
            {
                ConsoleUtils.UOut(ConsoleColor.Red, "You didn't enter an artist/band name. use like this : (/listalbums rammstein) (/listalbums the cure)");
                return;
            }
            string artistName = String.Join(" ", parameters.ToList().Skip(1)).ToLowerInvariant();

            foreach (KeyValuePair <string, string> artist in Subsonic.GetArtistIndexes())
            {
                if (artist.Key.ToLowerInvariant().Contains(artistName))
                {
                    foreach (var album in Subsonic.ListAlbums(artist.Value))
                    {
                        ConsoleUtils.UOut(ConsoleColor.Yellow, "({0}) {1} - {2}", artist.Key, album.Key, album.Value);
                    }
                }
            }
        }