Skip to content

Commit

Permalink
Fix pagination when no items are present (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
kade-robertson committed Jul 2, 2023
1 parent 404a102 commit d25cabd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Trakt/Api/TraktApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ private async Task<List<T>> GetFromTraktWithPaging<T>(string url, TraktUser trak
result.AddRange(tmpResult);
}

if (int.Parse(response.Headers.GetValues("X-Pagination-Page-Count").FirstOrDefault(page.ToString(CultureInfo.InvariantCulture)), CultureInfo.InvariantCulture) != page)
if (page < int.Parse(response.Headers.GetValues("X-Pagination-Page-Count").FirstOrDefault(page.ToString(CultureInfo.InvariantCulture)), CultureInfo.InvariantCulture))
{
page++;
}
Expand Down

0 comments on commit d25cabd

Please sign in to comment.