Skip to content

Commit a860f2a

Browse files
authored
feat: make top items paginatable (#1017)
1 parent e35302c commit a860f2a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

SpotifyAPI.Web/Clients/Interfaces/IUserProfileClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public interface IUserProfileClient
3636
/// <param name="cancel">The cancellation-token to allow to cancel the request.</param>
3737
/// <remarks>https://developer.spotify.com/documentation/web-api/reference/get-users-top-artists-and-tracks</remarks>
3838
/// <exception cref="APIUnauthorizedException">Thrown if the client is not authenticated.</exception>
39-
Task<UsersTopTracksResponse> GetTopTracks(UsersTopItemsRequest request, CancellationToken cancel = default);
39+
Task<CursorPaging<FullTrack>> GetTopTracks(UsersTopItemsRequest request, CancellationToken cancel = default);
4040

4141
/// <summary>
4242
/// Get Top arsists for the current user
@@ -45,6 +45,6 @@ public interface IUserProfileClient
4545
/// <param name="cancel">The cancellation-token to allow to cancel the request.</param>
4646
/// <remarks>https://developer.spotify.com/documentation/web-api/reference/get-users-top-artists-and-tracks</remarks>
4747
/// <exception cref="APIUnauthorizedException">Thrown if the client is not authenticated.</exception>
48-
Task<UsersTopArtistsResponse> GetTopArtists(UsersTopItemsRequest request, CancellationToken cancel = default);
48+
Task<CursorPaging<FullArtist>> GetTopArtists(UsersTopItemsRequest request, CancellationToken cancel = default);
4949
}
5050
}

SpotifyAPI.Web/Clients/UserProfileClient.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ public Task<PublicUser> Get(string userId, CancellationToken cancel = default)
2020
return API.Get<PublicUser>(SpotifyUrls.User(userId), cancel);
2121
}
2222

23-
public Task<UsersTopTracksResponse> GetTopTracks(UsersTopItemsRequest request, CancellationToken cancel = default)
23+
public Task<CursorPaging<FullTrack>> GetTopTracks(UsersTopItemsRequest request, CancellationToken cancel = default)
2424
{
2525
Ensure.ArgumentNotNull(request, nameof(request));
2626

27-
return API.Get<UsersTopTracksResponse>(SpotifyUrls.TopTracks(), request.BuildQueryParams(), cancel);
27+
return API.Get<CursorPaging<FullTrack>>(SpotifyUrls.TopTracks(), request.BuildQueryParams(), cancel);
2828

2929
}
3030

31-
public Task<UsersTopArtistsResponse> GetTopArtists(UsersTopItemsRequest request, CancellationToken cancel = default)
31+
public Task<CursorPaging<FullArtist>> GetTopArtists(UsersTopItemsRequest request, CancellationToken cancel = default)
3232
{
3333
Ensure.ArgumentNotNull(request, nameof(request));
3434

35-
return API.Get<UsersTopArtistsResponse>(SpotifyUrls.TopArtists(), request.BuildQueryParams(), cancel);
35+
return API.Get<CursorPaging<FullArtist>>(SpotifyUrls.TopArtists(), request.BuildQueryParams(), cancel);
3636
}
3737
}
3838
}

0 commit comments

Comments
 (0)