public override IEnumerable <IContent> Search() { ISearchSource TMDB = new Tmdb() { Filter = this.Filter, Actor = this.Actor, From = this.From, To = this.To }; Cache cache = new Cache() { Filter = this.Filter, Actor = this.Actor, From = this.From, To = this.To, Searcher = DataSourceType.TMDB }; IContentFinder finder = new ContentFinder(); var cachefound = finder.Search(cache); if (cachefound?.Count() > 0) { return(cachefound); } else { var tmdbfound = finder.Search(TMDB); cache.Set(tmdbfound); return(tmdbfound); } }
public override IEnumerable <IContent> Search() { ISearchSource youtube = new Youtube() { Filter = this.Filter }; Cache cache = new Cache() { Filter = this.Filter, Searcher = DataSourceType.YOUTUBE }; IContentFinder finder = new ContentFinder(); var cachefound = finder.Search(cache); if (cachefound?.Count() > 0) { return(cachefound); } else { var youtubefound = finder.Search(youtube); cache.Set(youtubefound); return(youtubefound); } }
public override IEnumerable <IContent> Search() { ISearchSource TMDB = new Tmdb() { Filter = this.Filter, Actor = this.Actor, From = this.From, To = this.To }; ISearchSource youtube = new Youtube() { Filter = this.Filter }; Cache cache = new Cache() { Filter = this.Filter, Actor = this.Actor, From = this.From, To = this.To }; IContentFinder finder = new ContentFinder(); var cachefound = finder.Search(cache); if (cachefound?.Count() > 0) { return(cachefound); } else { var tmdbfound = finder.Search(TMDB); var youtubefound = finder.Search(youtube); cache.Set(tmdbfound); cache.Set(youtubefound); var merged = tmdbfound.Concat(youtubefound); return(merged); } }
public override IEnumerable <IContent> Search() { Cache cache = new Cache() { Filter = this.Filter, Actor = this.Actor, From = this.From, To = this.To }; IContentFinder finder = new ContentFinder(); try { var cachefound = finder.Search(cache); return(cachefound); } catch { return(null); } }