mirror of
https://github.com/Sarsoo/Spotify.NET.git
synced 2024-12-24 23:16:28 +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")]
|
[JsonProperty("total")]
|
||||||
public int Total { get; set; }
|
public int Total { get; set; }
|
||||||
|
|
||||||
|
public bool HasNext()
|
||||||
|
{
|
||||||
|
return !string.IsNullOrEmpty(Next);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2694,11 +2694,23 @@ namespace SpotifyAPI.Web
|
|||||||
return DownloadData<TOut>(paging.Next);
|
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)
|
public Paging<T> GetNextPage<T>(Paging<T> paging)
|
||||||
{
|
{
|
||||||
return GetNextPage<Paging<T>, 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
|
public Task<TOut> GetNextPageAsync<TOut, TIn>(Paging<TIn> paging) where TOut : BasicModel
|
||||||
{
|
{
|
||||||
if (!paging.HasNextPage())
|
if (!paging.HasNextPage())
|
||||||
@ -2706,11 +2718,23 @@ namespace SpotifyAPI.Web
|
|||||||
return DownloadDataAsync<TOut>(paging.Next);
|
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)
|
public Task<Paging<T>> GetNextPageAsync<T>(Paging<T> paging)
|
||||||
{
|
{
|
||||||
return GetNextPageAsync<Paging<T>, 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
|
public TOut GetPreviousPage<TOut, TIn>(Paging<TIn> paging) where TOut : BasicModel
|
||||||
{
|
{
|
||||||
if (!paging.HasPreviousPage())
|
if (!paging.HasPreviousPage())
|
||||||
|
Loading…
Reference in New Issue
Block a user