diff --git a/SpotifyAPI.Web/Clients/Interfaces/ISpotifyClient.cs b/SpotifyAPI.Web/Clients/Interfaces/ISpotifyClient.cs index 4dca71c00..ed5d267eb 100644 --- a/SpotifyAPI.Web/Clients/Interfaces/ISpotifyClient.cs +++ b/SpotifyAPI.Web/Clients/Interfaces/ISpotifyClient.cs @@ -105,9 +105,10 @@ public interface ISpotifyClient /// /// The first page, will be included in the output list! /// Optional. If not supplied, DefaultPaginator will be used + /// The cancellation-token to allow to cancel the request. /// The Paging-Type /// A list containing all fetched pages - Task> PaginateAll(IPaginatable firstPage, IPaginator? paginator = default!); + Task> PaginateAll(IPaginatable firstPage, IPaginator? paginator = default!, CancellationToken cancellationToken = default); /// /// Fetches all pages and returns them grouped in a list. diff --git a/SpotifyAPI.Web/Clients/SpotifyClient.cs b/SpotifyAPI.Web/Clients/SpotifyClient.cs index d291a261b..93c8b54d2 100644 --- a/SpotifyAPI.Web/Clients/SpotifyClient.cs +++ b/SpotifyAPI.Web/Clients/SpotifyClient.cs @@ -91,11 +91,12 @@ public SpotifyClient(SpotifyClientConfig config) /// /// The first page, will be included in the output list! /// Optional. If not supplied, DefaultPaginator will be used + /// The cancellation-token to allow to cancel the request. /// The Paging-Type /// A list containing all fetched pages - public Task> PaginateAll(IPaginatable firstPage, IPaginator? paginator = null) + public Task> PaginateAll(IPaginatable firstPage, IPaginator? paginator = null, CancellationToken cancellationToken = default) { - return (paginator ?? DefaultPaginator).PaginateAll(firstPage, _apiConnector); + return (paginator ?? DefaultPaginator).PaginateAll(firstPage, _apiConnector, cancellationToken); } ///