Example #1
0
        public async Task <Page <Artist> > GetTopArtists(string accessToken = null, int?limit = null, int offset = 0, TimeRange timeRange = TimeRange.LongTerm)
        {
            string url = $"{BaseUrl}/me/top/artists?";

            if (limit.HasValue)
            {
                url += $"limit={limit.Value}&offset={offset}&";
            }
            url += "time_range=" + timeRange.GetDescription();
            return(await GetModel <Page <Artist> >(url, accessToken));
        }
Example #2
0
 public Task <Page <T> > GetAsync(int limit, int offset, TimeRange timeRange, CancellationToken cancellationToken)
 {
     return(this.GetAsync <Page <T> >(
                cancellationToken,
                queryStringParameters: new { limit, offset, time_range = timeRange.GetDescription() }));
 }