diff --git a/SpotifyAPI/Web/SpotifyWebAPI.cs b/SpotifyAPI/Web/SpotifyWebAPI.cs index c7902e7e..ad1b56b5 100644 --- a/SpotifyAPI/Web/SpotifyWebAPI.cs +++ b/SpotifyAPI/Web/SpotifyWebAPI.cs @@ -1767,32 +1767,52 @@ namespace SpotifyAPI.Web #region Util - public Paging GetNextPage(Paging paging) + public TOut GetNextPage(Paging paging) { if (!paging.HasNextPage()) throw new InvalidOperationException("This Paging-Object has no Next-Page"); - return DownloadData>(paging.Next); + return DownloadData(paging.Next); + } + + public Paging GetNextPage(Paging paging) + { + return GetNextPage, T>(paging); + } + + public async Task GetNextPageAsync(Paging paging) + { + if (!paging.HasNextPage()) + throw new InvalidOperationException("This Paging-Object has no Next-Page"); + return await DownloadDataAsync(paging.Next); } public async Task> GetNextPageAsync(Paging paging) { - if (!paging.HasNextPage()) - throw new InvalidOperationException("This Paging-Object has no Next-Page"); - return await DownloadDataAsync>(paging.Next); + return await GetNextPageAsync, T>(paging); + } + + public TOut GetPreviousPage(Paging paging) + { + if (!paging.HasPreviousPage()) + throw new InvalidOperationException("This Paging-Object has no Previous-Page"); + return DownloadData(paging.Previous); } public Paging GetPreviousPage(Paging paging) + { + return GetPreviousPage, T>(paging); + } + + public async Task GetPreviousPageAsync(Paging paging) { if (!paging.HasPreviousPage()) throw new InvalidOperationException("This Paging-Object has no Previous-Page"); - return DownloadData>(paging.Previous); + return await DownloadDataAsync(paging.Previous); } public async Task> GetPreviousPageAsync(Paging paging) { - if (!paging.HasPreviousPage()) - throw new InvalidOperationException("This Paging-Object has no Previous-Page"); - return await DownloadDataAsync>(paging.Previous); + return await GetPreviousPageAsync, T>(paging); } public T UploadData(string url, string uploadData, string method = "POST")