public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            var parameters = new BroadcastheNetTorrentQuery();

            if (AddSeriesSearchParameters(parameters, searchCriteria))
            {
                var episodeQueryTitle = searchCriteria.Episodes.Where(e => !string.IsNullOrWhiteSpace(e.Title))
                                        .Select(e => SearchCriteriaBase.GetQueryTitle(e.Title))
                                        .ToArray();

                foreach (var queryTitle in episodeQueryTitle)
                {
                    parameters = parameters.Clone();

                    parameters.Category = "Episode";
                    parameters.Name     = "%" + queryTitle + "%";


                    pageableRequests.Add(GetPagedRequests(MaxPages, parameters));
                }
            }

            return(pageableRequests);
        }
示例#2
0
        public override IList <ReleaseInfo> Fetch(SpecialEpisodeSearchCriteria searchCriteria)
        {
            if (!SupportsSearch)
            {
                return(new List <ReleaseInfo>());
            }

            return(FetchReleases(g => g.GetSearchRequests(searchCriteria)));
        }
示例#3
0
        public override IList <ReleaseInfo> Fetch(SpecialEpisodeSearchCriteria searchCriteria)
        {
            if (!SupportsSearch)
            {
                return(new List <ReleaseInfo>());
            }

            var generator = GetRequestGenerator();

            return(FetchReleases(generator.GetSearchRequests(searchCriteria)));
        }
        public virtual IList <IEnumerable <IndexerRequest> > GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new List <IEnumerable <IndexerRequest> >();

            foreach (var queryTitle in searchCriteria.EpisodeQueryTitles)
            {
                pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, "usearch",
                                                               PrepareQuery(queryTitle),
                                                               "category:tv"));
            }

            return(pageableRequests);
        }
示例#5
0
        public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            foreach (var queryTitle in searchCriteria.EpisodeQueryTitles)
            {
                pageableRequests.Add(GetPagedRequests(MaxPages, "usearch",
                                                      PrepareQuery(queryTitle),
                                                      "category:tv"));
            }

            return(pageableRequests);
        }
示例#6
0
        public virtual IList <IEnumerable <IndexerRequest> > GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new List <IEnumerable <IndexerRequest> >();

            foreach (var queryTitle in searchCriteria.EpisodeQueryTitles)
            {
                pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages,
                                                               String.Format("&term={0}",
                                                                             PrepareQuery(queryTitle))));
            }

            return(pageableRequests);
        }
示例#7
0
        public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            foreach (var queryTitle in searchCriteria.EpisodeQueryTitles)
            {
                pageableRequests.Add(GetPagedRequests(MaxPages,
                                                      string.Format("&term={0}",
                                                                    PrepareQuery(queryTitle))));
            }

            return(pageableRequests);
        }
        public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            foreach (var queryTitle in searchCriteria.EpisodeQueryTitles)
            {
                var query = queryTitle.Replace('+', ' ');
                query = System.Web.HttpUtility.UrlEncode(query);

                pageableRequests.Add(GetPagedRequests(query));
            }

            return(pageableRequests);
        }
        public virtual IList <IEnumerable <IndexerRequest> > GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new List <IEnumerable <IndexerRequest> >();

            foreach (var queryTitle in searchCriteria.EpisodeQueryTitles)
            {
                var query = queryTitle.Replace('+', ' ');
                query = System.Web.HttpUtility.UrlEncode(query);

                pageableRequests.AddIfNotNull(GetPagedRequests(query));
            }

            return(pageableRequests);
        }
示例#10
0
        public IList <ReleaseInfo> Fetch(IIndexer indexer, SpecialEpisodeSearchCriteria searchCriteria)
        {
            var queryUrls = new List <String>();

            foreach (var episodeQueryTitle in searchCriteria.EpisodeQueryTitles)
            {
                _logger.Debug("Performing query of {0} for {1}", indexer, episodeQueryTitle);
                queryUrls.AddRange(indexer.GetSearchUrls(episodeQueryTitle));
            }

            var result = Fetch(indexer, queryUrls);

            _logger.Info("Finished searching {0} for {1}. Found {2}", indexer, searchCriteria, result.Count);
            return(result);
        }
示例#11
0
        public virtual IList <IEnumerable <IndexerRequest> > GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new List <IEnumerable <IndexerRequest> >();

            foreach (var queryTitle in searchCriteria.EpisodeQueryTitles)
            {
                var query = queryTitle.Replace('+', ' ');
                query = System.Web.HttpUtility.UrlEncode(query);

                pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, Settings.Categories.Concat(Settings.AnimeCategories), "search",
                                                               String.Format("&q={0}",
                                                                             query)));
            }

            return(pageableRequests);
        }
示例#12
0
        public IList <ReleaseInfo> Fetch(IIndexer indexer, SpecialEpisodeSearchCriteria searchCriteria)
        {
            var searchUrls = new List <String>();

            foreach (var episodeQueryTitle in searchCriteria.EpisodeQueryTitles)
            {
                var urls = indexer.GetSearchUrls(episodeQueryTitle).ToList();

                if (urls.Any())
                {
                    _logger.Debug("Performing query of {0} for {1}", indexer, episodeQueryTitle);
                    searchUrls.AddRange(urls);
                }
            }

            return(Fetch(indexer, searchUrls, searchCriteria));
        }
示例#13
0
        public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            if (SupportsSearch)
            {
                foreach (var queryTitle in searchCriteria.EpisodeQueryTitles)
                {
                    var query = queryTitle.Replace('+', ' ');
                    query = System.Web.HttpUtility.UrlEncode(query);

                    pageableRequests.Add(GetPagedRequests(MaxPages, Settings.Categories.Concat(Settings.AnimeCategories), "search",
                                                          string.Format("&q={0}",
                                                                        query)));
                }
            }

            return(pageableRequests);
        }
示例#14
0
 public IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
 {
     throw new NotImplementedException();
 }
示例#15
0
 public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
 {
     return(new IndexerPageableRequestChain());
 }
示例#16
0
 public abstract IList <ReleaseInfo> Fetch(SpecialEpisodeSearchCriteria searchCriteria);
示例#17
0
 public virtual IList <IEnumerable <IndexerRequest> > GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
 {
     return(new List <IEnumerable <IndexerRequest> >());
 }