public async Task <IActionResult> TakeTopYT() { var top = await _actuallRepository.GetAllActuallYTAsync(); var topImg = await _actuallRepository.GetAllActuallIMGAsync(); if (top.Where(x => x.isSong).Count() == 0) { await _updateRepository.SongsUpdateAsync(); } if (top.Where(x => !x.isSong).Count() == 0) { await _updateRepository.TvMoviesUpdateAsync(true); } if (top.Count > 0) { top.AddRange(topImg); } top = top.Where(x => !x.id.Contains("Error")).ToList(); top.Shuffle(); return(Json(top)); }
public async Task <IActionResult> SearchIcons([FromBody] ExploreQuery Query) { string query = Query.query; int count = Query.count; int skip = count * Query.next; if (!string.IsNullOrEmpty(query)) { var explore = await _exploreRepository.ExploreIconsAsync(query, count, skip); return(Json(explore)); } var top = await _exploreRepository.GetAllActuallYTAsync(); var topImg = await _exploreRepository.GetAllActuallIMGAsync(); if (top.Count > 0) { top.AddRange(topImg); } top = top.Skip(skip).Take(count).ToList(); //var results = new ExploreResultsDto(top, 6, 1); return(Json(top)); }