public async Task <IEnumerable <SearchTvShowViewModel> > Popular(int currentlyLoaded, int amountToLoad, string langCustomCode = null) { var langCode = await DefaultLanguageCode(langCustomCode); var pages = PaginationHelper.GetNextPages(currentlyLoaded, amountToLoad, ResultLimit); var results = new List <MovieDbSearchResult>(); foreach (var pagesToLoad in pages) { var apiResult = await Cache.GetOrAddAsync(nameof(Popular) + langCode + pagesToLoad.Page, async() => await _movieApi.PopularTv(langCode, pagesToLoad.Page), DateTimeOffset.Now.AddHours(12)); results.AddRange(apiResult.Skip(pagesToLoad.Skip).Take(pagesToLoad.Take)); } var processed = ProcessResults(results); return(await processed); }