Exemplo n.º 1
0
        public HttpResponseMessage GetAlbumsByArtists(string[] artistIds)
        {
            var result = new List <SimpleAlbum>();

            var api = new SpotifyAPI.Web.SpotifyWebAPI()
            {
                AccessToken = this.AccessToken.AccessToken,
                TokenType   = this.AccessToken.TokenType,
                UseAuth     = true
            };

            foreach (var artistId in artistIds)
            {
                var albumPage = api.GetArtistsAlbums(artistId, SpotifyAPI.Web.Enums.AlbumType.All);

                result.AddRange(albumPage.Items);
            }

            return(this.Request.CreateResponse(HttpStatusCode.OK, result));
        }