mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 16:22:55 -07:00
We now have infinite scroll!
Also fixed some more unit tests
This commit is contained in:
parent
4e0459eef0
commit
961ba4297a
11 changed files with 162 additions and 68 deletions
|
@ -21,6 +21,7 @@ using Ombi.Core.Authentication;
|
|||
using Ombi.Helpers;
|
||||
using Ombi.Settings.Settings.Models;
|
||||
using Ombi.Store.Entities;
|
||||
using TraktApiSharp.Objects.Get.Shows;
|
||||
|
||||
namespace Ombi.Core.Engine
|
||||
{
|
||||
|
@ -127,6 +128,19 @@ namespace Ombi.Core.Engine
|
|||
return processed;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SearchTvShowViewModel>> Popular(int currentlyLoaded, int amountToLoad)
|
||||
{
|
||||
var pages = PaginationHelper.GetNextPages(currentlyLoaded, amountToLoad, ResultLimit);
|
||||
var results = new List<TraktShow>();
|
||||
foreach (var pagesToLoad in pages)
|
||||
{
|
||||
var apiResult = await TraktApi.GetPopularShows(pagesToLoad.Page, ResultLimit);
|
||||
results.AddRange(apiResult.Skip(pagesToLoad.Skip).Take(pagesToLoad.Take));
|
||||
}
|
||||
var processed = ProcessResults(results);
|
||||
return processed;
|
||||
}
|
||||
|
||||
public async Task<IEnumerable<SearchTvShowViewModel>> Anticipated()
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue