コード例 #1
0
        public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            var searchTitles = searchCriteria.QueryTitles.SelectMany(v => GetTitleSearchStrings(v, searchCriteria.AbsoluteEpisodeNumber)).ToList();

            pageableRequests.Add(GetPagedRequests(string.Join("|", searchTitles)));

            return pageableRequests;
        }
コード例 #2
0
        public void SetUp()
        {
            UseRealHttp();

            _singleSearchCriteria = new SingleEpisodeSearchCriteria()
                {
                    SceneTitles = new List<string> { "Person of Interest" },
                    SeasonNumber = 1,
                    EpisodeNumber = 1
                };

            _animeSearchCriteria = new AnimeEpisodeSearchCriteria()
            {
                SceneTitles = new List<string> { "Steins;Gate" },
                AbsoluteEpisodeNumber = 1
            };
        }
コード例 #3
0
        public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            var queryBase = new TorrentQuery();
            if (TryAddSearchParameters(queryBase, searchCriteria))
            {
                foreach (var episode in searchCriteria.Episodes)
                {
                    var query = queryBase.Clone();

                    query.TvdbInfo.Season = episode.SeasonNumber;
                    query.TvdbInfo.Episode = episode.EpisodeNumber;
                }
            }

            return pageableRequests;
        }
コード例 #4
0
ファイル: HDBitsRequestGenerator.cs プロジェクト: nnic/Sonarr
        public IList<IEnumerable<IndexerRequest>> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
        {
            var requests = new List<IEnumerable<IndexerRequest>>();

            var queryBase = new TorrentQuery();
            if (TryAddSearchParameters(queryBase, searchCriteria))
            {
                foreach (var episode in searchCriteria.Episodes)
                {
                    var query = queryBase.Clone();

                    query.TvdbInfo.Season = episode.SeasonNumber;
                    query.TvdbInfo.Episode = episode.EpisodeNumber;
                }
            }

            return requests;
        }
コード例 #5
0
        public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            foreach (var queryTitle in searchCriteria.QueryTitles)
            {
                var searchTitle = PrepareQuery(queryTitle);

                pageableRequests.Add(GetPagedRequests(MaxPages, $"{searchTitle}+{searchCriteria.AbsoluteEpisodeNumber:0}"));

                if (searchCriteria.AbsoluteEpisodeNumber < 10)
                {
                    pageableRequests.Add(GetPagedRequests(MaxPages, $"{searchTitle}+{searchCriteria.AbsoluteEpisodeNumber:00}"));
                }
            }

            return pageableRequests;
        }
コード例 #6
0
ファイル: NyaaRequestGenerator.cs プロジェクト: keep3r/Sonarr
        public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new List<IEnumerable<IndexerRequest>>();

            foreach (var queryTitle in searchCriteria.QueryTitles)
            {
                var searchTitle = PrepareQuery(queryTitle);

                pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages,
                    String.Format("&term={0}+{1:0}",
                    searchTitle,
                    searchCriteria.AbsoluteEpisodeNumber)));

                if (searchCriteria.AbsoluteEpisodeNumber < 10)
                {
                    pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages,
                        String.Format("&term={0}+{1:00}",
                        searchTitle,
                        searchCriteria.AbsoluteEpisodeNumber)));
                }
            }

            return pageableRequests;
        }
コード例 #7
0
 public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
 {
     return new IndexerPageableRequestChain();
 }
コード例 #8
0
ファイル: EztvRequestGenerator.cs プロジェクト: keep3r/Sonarr
 public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
 {
     return new List<IEnumerable<IndexerRequest>>();
 }
コード例 #9
0
        public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new List<IEnumerable<IndexerRequest>>();

            foreach (var queryTitle in searchCriteria.QueryTitles)
            {
                pageableRequests.AddIfNotNull(GetPagedRequests(MaxPages, Settings.AnimeCategories, "search",
                    String.Format("&q={0}+{1:00}",
                    NewsnabifyTitle(queryTitle),
                    searchCriteria.AbsoluteEpisodeNumber)));
            }

            return pageableRequests;
        }
コード例 #10
0
ファイル: IndexerFetchService.cs プロジェクト: BO45/NzbDrone
        public IList<ReleaseInfo> Fetch(IIndexer indexer, AnimeEpisodeSearchCriteria searchCriteria)
        {
            _logger.Debug("Searching for {0}", searchCriteria);

            var searchUrls = indexer.GetAnimeEpisodeSearchUrls(searchCriteria.SceneTitles, searchCriteria.Series.TvRageId, searchCriteria.AbsoluteEpisodeNumber);
            var result = Fetch(indexer, searchUrls);
            _logger.Info("Finished searching {0} for {1}. Found {2}", indexer, searchCriteria, result.Count);

            return result;
        }
コード例 #11
0
        public virtual IList<IEnumerable<IndexerRequest>> GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequest = new List<IEnumerable<IndexerRequest>>();

            var parameters = new BroadcastheNetTorrentQuery();
            if (AddSeriesSearchParameters(parameters, searchCriteria))
            {
                foreach (var episode in searchCriteria.Episodes)
                {
                    parameters = parameters.Clone();

                    parameters.Category = "Episode";
                    parameters.Name = String.Format("S{0:00}E{1:00}", episode.SeasonNumber, episode.EpisodeNumber);

                    pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters));
                }

                foreach (var seasonNumber in searchCriteria.Episodes.Select(v => v.SeasonNumber).Distinct())
                {
                    parameters = parameters.Clone();

                    parameters.Category = "Season";
                    parameters.Name = String.Format("Season {0}", seasonNumber);

                    pageableRequest.AddIfNotNull(GetPagedRequests(MaxPages, parameters));
                }
            }

            return pageableRequest;
        }
コード例 #12
0
        public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            if (SupportsSearch)
            {
                foreach (var queryTitle in searchCriteria.QueryTitles)
                {
                    pageableRequests.Add(GetPagedRequests(MaxPages, Settings.AnimeCategories, "search",
                        string.Format("&q={0}+{1:00}",
                        NewsnabifyTitle(queryTitle),
                        searchCriteria.AbsoluteEpisodeNumber)));
                }
            }

            return pageableRequests;
        }