/// <summary>
        ///     Get Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string
        ///     to filter and sort the response.
        /// </summary>
        /// <param name="id">The Spotify ID for the artist.</param>
        /// <param name="type">
        ///     A list of keywords that will be used to filter the response. If not supplied, all album types will
        ///     be returned
        /// </param>
        /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.</param>
        /// <param name="offset">The index of the first album to return. Default: 0</param>
        /// <param name="market">
        ///     An ISO 3166-1 alpha-2 country code. Supply this parameter to limit the response to one particular
        ///     geographical market
        /// </param>
        /// <returns></returns>
        public string GetArtistsAlbums(string id, AlbumType type = AlbumType.All, int limit = 20, int offset = 0, string market = "")
        {
            limit = Math.Min(limit, 50);
            StringBuilder builder = new StringBuilder(APIBase + "/artists/" + id + "/albums");

            builder.Append("?album_type=" + type.GetStringAttribute(","));
            builder.Append("&limit=" + limit);
            builder.Append("&offset=" + offset);
            if (!string.IsNullOrEmpty(market))
            {
                builder.Append("&market=" + market);
            }
            return(builder.ToString());
        }
        public Paging <SimpleAlbum> GetArtistsAlbums(String id, AlbumType type = AlbumType.ALL, String market = "", int limit = 20, int offset = 0)
        {
            limit = Math.Min(50, limit);
            StringBuilder builder = new StringBuilder("https://api.spotify.com/v1/artists/" + id + "/albums");

            builder.Append("?type=" + type.GetStringAttribute(","));
            builder.Append("&limit=" + limit);
            builder.Append("&offset=" + offset);
            if (market != "")
            {
                builder.Append("&market=" + market);
            }
            return(DownloadData <Paging <SimpleAlbum> >(builder.ToString()));
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Get Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string to filter and sort the response.
        /// </summary>
        /// <param name="id">The Spotify ID for the artist.</param>
        /// <param name="type">A list of keywords that will be used to filter the response. If not supplied, all album types will be returned</param>
        /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.</param>
        /// <param name="offset">The index of the first album to return. Default: 0</param>
        /// <param name="market">An ISO 3166-1 alpha-2 country code. Supply this parameter to limit the response to one particular geographical market</param>
        /// <returns></returns>
        public Paging <SimpleAlbum> GetArtistsAlbums(String id, AlbumType type = AlbumType.All, int limit = 20, int offset = 0, String market = "")
        {
            limit = Math.Min(limit, 50);
            StringBuilder builder = new StringBuilder(APIBase + "/artists/" + id + "/albums");

            builder.Append("?type=" + type.GetStringAttribute(","));
            builder.Append("&limit=" + limit);
            builder.Append("&offset=" + offset);
            if (market != "")
            {
                builder.Append("&market=" + market);
            }
            return(DownloadData <Paging <SimpleAlbum> >(builder.ToString()));
        }
Ejemplo n.º 4
0
 /// <summary>
 ///     Get Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string
 ///     to filter and sort the response.
 /// </summary>
 /// <param name="id">The Spotify ID for the artist.</param>
 /// <param name="type">
 ///     A list of keywords that will be used to filter the response. If not supplied, all album types will
 ///     be returned
 /// </param>
 /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.</param>
 /// <param name="offset">The index of the first album to return. Default: 0</param>
 /// <param name="market">
 ///     An ISO 3166-1 alpha-2 country code. Supply this parameter to limit the response to one particular
 ///     geographical market
 /// </param>
 /// <returns></returns>
 public string GetArtistsAlbums(String id, AlbumType type = AlbumType.All, int limit = 20, int offset = 0, String market = "")
 {
     limit = Math.Min(limit, 50);
     StringBuilder builder = new StringBuilder(APIBase + "/artists/" + id + "/albums");
     builder.Append("?album_type=" + type.GetStringAttribute(","));
     builder.Append("&limit=" + limit);
     builder.Append("&offset=" + offset);
     if (!String.IsNullOrEmpty(market))
         builder.Append("&market=" + market);
     return builder.ToString();
 }