Ejemplo n.º 1
0
        public static IList <Album_info> Search_Album(long id, int i = 30)
        {
            var api    = new NeteaseMusicAPI();
            var apires = api.Album(id);
            List <Album_info> musics = new List <Album_info>();
            var name           = apires.Album.Name;
            var album_username = apires.Album.Artists[0].Name;
            var img            = apires.Album.PicUrl;
            int a = 0;

            foreach (var song in apires.Songs)
            {
                if (a < i)
                {
                    Album_info music = new Album_info();
                    music.album_username = album_username;
                    music.dec            = apires.Album.Description.ToString();
                    music.music_name     = string.Format("{0}", song.Name);
                    music.musci_url      = api.GetSongsUrl(new long[] { song.Id }).Data[0].Url;
                    //    music.music_alname = song.Al.Name;
                    music.id     = song.Id;
                    music.name   = name;
                    music.img    = img;
                    music.singer = song.Ar[0].Name;
                    musics.Add(music);
                    a++;
                }
                else
                {
                    break;
                }
            }
            return(musics);
        }