new public async Task <IEnumerable <SearchTvShowViewModel> > Search(string search) { var searchResult = await TvMazeApi.Search(search); for (var i = 0; i < searchResult.Count; i++) { if (!_demoLists.TvShows.Contains(searchResult[i].show?.externals?.thetvdb ?? 0)) { searchResult.RemoveAt(i); } } if (searchResult != null) { var retVal = new List <SearchTvShowViewModel>(); foreach (var tvMazeSearch in searchResult) { if (tvMazeSearch.show.externals == null || !(tvMazeSearch.show.externals?.thetvdb.HasValue ?? false)) { continue; } retVal.Add(await ProcessResult(tvMazeSearch, false)); } return(retVal); } return(null); }
public async Task <IEnumerable <SearchTvShowViewModel> > Search(string searchTerm) { var searchResult = await TvMazeApi.Search(searchTerm); if (searchResult != null) { var retVal = new List <SearchTvShowViewModel>(); foreach (var tvMazeSearch in searchResult) { if (tvMazeSearch.show.externals == null || !(tvMazeSearch.show.externals?.thetvdb.HasValue ?? false)) { continue; } var mappedResult = await ProcessResult(tvMazeSearch, false); if (mappedResult == null) { continue; } retVal.Add(mappedResult); } return(retVal); } return(null); }
public async Task <IEnumerable <SearchTvShowViewModel> > Search(string searchTerm) { var searchResult = await TvMazeApi.Search(searchTerm); if (searchResult != null) { return(await ProcessResults(searchResult)); } return(null); }