mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 06:56:27 +00:00
Added overload for NextPage stuff CursorPaging
This commit is contained in:
parent
4cfda50859
commit
67427cdb72
@ -22,5 +22,10 @@ namespace SpotifyAPI.Web.Models
|
||||
|
||||
[JsonProperty("total")]
|
||||
public int Total { get; set; }
|
||||
|
||||
public bool HasNext()
|
||||
{
|
||||
return !string.IsNullOrEmpty(Next);
|
||||
}
|
||||
}
|
||||
}
|
@ -2694,11 +2694,23 @@ namespace SpotifyAPI.Web
|
||||
return DownloadData<TOut>(paging.Next);
|
||||
}
|
||||
|
||||
public TOut GetNextPage<TOut, TIn>(CursorPaging<TIn> paging) where TOut : BasicModel
|
||||
{
|
||||
if (!paging.HasNext())
|
||||
throw new InvalidOperationException("This CursorPaging-Object has no Next-Page");
|
||||
return DownloadData<TOut>(paging.Next);
|
||||
}
|
||||
|
||||
public Paging<T> GetNextPage<T>(Paging<T> paging)
|
||||
{
|
||||
return GetNextPage<Paging<T>, T>(paging);
|
||||
}
|
||||
|
||||
public CursorPaging<T> GetNextPage<T>(CursorPaging<T> paging)
|
||||
{
|
||||
return GetNextPage<CursorPaging<T>, T>(paging);
|
||||
}
|
||||
|
||||
public Task<TOut> GetNextPageAsync<TOut, TIn>(Paging<TIn> paging) where TOut : BasicModel
|
||||
{
|
||||
if (!paging.HasNextPage())
|
||||
@ -2706,11 +2718,23 @@ namespace SpotifyAPI.Web
|
||||
return DownloadDataAsync<TOut>(paging.Next);
|
||||
}
|
||||
|
||||
public Task<TOut> GetNextPageAsync<TOut, TIn>(CursorPaging<TIn> paging) where TOut : BasicModel
|
||||
{
|
||||
if (!paging.HasNext())
|
||||
throw new InvalidOperationException("This Paging-Object has no Next-Page");
|
||||
return DownloadDataAsync<TOut>(paging.Next);
|
||||
}
|
||||
|
||||
public Task<Paging<T>> GetNextPageAsync<T>(Paging<T> paging)
|
||||
{
|
||||
return GetNextPageAsync<Paging<T>, T>(paging);
|
||||
}
|
||||
|
||||
public Task<CursorPaging<T>> GetNextPageAsync<T>(CursorPaging<T> paging)
|
||||
{
|
||||
return GetNextPageAsync<CursorPaging<T>, T>(paging);
|
||||
}
|
||||
|
||||
public TOut GetPreviousPage<TOut, TIn>(Paging<TIn> paging) where TOut : BasicModel
|
||||
{
|
||||
if (!paging.HasPreviousPage())
|
||||
|
Loading…
Reference in New Issue
Block a user