Exemplo n.º 1
0
        public IndexerPageableRequestChain GetSearchRequests(AuthorSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            pageableRequests.Add(GetRequest(string.Format("&artistname={0}", searchCriteria.AuthorQuery)));
            return(pageableRequests);
        }
Exemplo n.º 2
0
        public IndexerPageableRequestChain GetSearchRequests(AuthorSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            pageableRequests.Add(GetRequest("search-torrents", Settings.Categories, string.Format(" & type=name&query={0}", Uri.EscapeDataString(searchCriteria.AuthorQuery.Trim()))));

            return(pageableRequests);
        }
Exemplo n.º 3
0
        public virtual IndexerPageableRequestChain GetSearchRequests(AuthorSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            pageableRequests.Add(GetPagedRequests("search", null, "{0}", searchCriteria.AuthorQuery));

            return(pageableRequests);
        }
Exemplo n.º 4
0
        public override IList <ReleaseInfo> Fetch(AuthorSearchCriteria searchCriteria)
        {
            if (!SupportsSearch)
            {
                return(new List <ReleaseInfo>());
            }

            return(FetchReleases(g => g.GetSearchRequests(searchCriteria)));
        }
        public void should_only_include_reports_for_requested_books()
        {
            var author = Builder <Author> .CreateNew().Build();

            var books = Builder <Book> .CreateListOfSize(2)
                        .All()
                        .With(v => v.AuthorId, author.Id)
                        .With(v => v.Author, new LazyLoaded <Author>(author))
                        .BuildList();

            var criteria = new AuthorSearchCriteria {
                Books = books.Take(1).ToList()
            };

            var reports = books.Select(v =>
                                       new ReleaseInfo()
            {
                Title = string.Format("{0}-{1}[FLAC][2017][DRONE]", author.Name, v.Title)
            }).ToList();

            Mocker.GetMock <IParsingService>()
            .Setup(v => v.Map(It.IsAny <ParsedBookInfo>(), It.IsAny <SearchCriteriaBase>()))
            .Returns <ParsedBookInfo, SearchCriteriaBase>((p, c) =>
                                                          new RemoteBook
            {
                DownloadAllowed = true,
                ParsedBookInfo  = p,
                Author          = author,
                Books           = books.Where(v => v.Title == p.BookTitle).ToList()
            });

            Mocker.SetConstant <IEnumerable <IDecisionEngineSpecification> >(new List <IDecisionEngineSpecification>
            {
                Mocker.Resolve <NzbDrone.Core.DecisionEngine.Specifications.Search.BookRequestedSpecification>()
            });

            var decisions = Subject.GetSearchDecision(reports, criteria);

            var approvedDecisions = decisions.Where(v => v.Approved).ToList();

            approvedDecisions.Count.Should().Be(1);
        }
Exemplo n.º 6
0
        public virtual IndexerPageableRequestChain GetSearchRequests(AuthorSearchCriteria searchCriteria)
        {
            var pageableRequests = new IndexerPageableRequestChain();

            if (SupportsBookSearch)
            {
                AddBookPageableRequests(pageableRequests,
                                        searchCriteria,
                                        NewsnabifyTitle($"&author={searchCriteria.AuthorQuery}"));
            }

            if (SupportsSearch)
            {
                pageableRequests.AddTier();

                pageableRequests.Add(GetPagedRequests(MaxPages,
                                                      Settings.Categories,
                                                      "search",
                                                      NewsnabifyTitle($"&q={searchCriteria.AuthorQuery}")));
            }

            return(pageableRequests);
        }
Exemplo n.º 7
0
 public List<AuthorBLL> ResolveSearch(AuthorSearchCriteria criteria, int pageSize, int pageNumber, out int numResults, out int totalPages)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 public List<AuthorBLL> ResolveSearch(AuthorSearchCriteria criteria)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 9
0
 public virtual IndexerPageableRequestChain GetSearchRequests(AuthorSearchCriteria searchCriteria)
 {
     throw new System.NotImplementedException();
 }
Exemplo n.º 10
0
 public abstract IList <ReleaseInfo> Fetch(AuthorSearchCriteria searchCriteria);