diff --git a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs index 86f302ae5..0fdf8e3d9 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs @@ -67,125 +67,6 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests page.Url.Query.Should().Contain("&cat=1,2&"); } - //We dont use Anime Categories so there is no need to check for proper concat in feed - - //[Test] - //public void should_not_have_duplicate_categories() - //{ - // Subject.Settings.Categories = new[] { 1, 2, 3 }; - - // var results = Subject.GetRecentRequests(); - - // results.GetAllTiers().Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.FullUri.Should().Contain("&cat=1,2,3,4&"); - //} - - //[Test] - //public void should_use_only_anime_categories_for_anime_search() - //{ - // var results = Subject.GetSearchRequests(_animeSearchCriteria); - - // results.GetAllTiers().Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.FullUri.Should().Contain("&cat=3,4&"); - //} - - //[Test] - //public void should_use_mode_search_for_anime() - //{ - // var results = Subject.GetSearchRequests(_animeSearchCriteria); - - // results.GetAllTiers().Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.FullUri.Should().Contain("?t=search&"); - //} - - //[Test] - //public void should_return_subsequent_pages() - //{ - // var results = Subject.GetSearchRequests(_animeSearchCriteria); - - // results.GetAllTiers().Should().HaveCount(1); - - // var pages = results.GetAllTiers().First().Take(3).ToList(); - - // pages[0].Url.FullUri.Should().Contain("&offset=0&"); - // pages[1].Url.FullUri.Should().Contain("&offset=100&"); - // pages[2].Url.FullUri.Should().Contain("&offset=200&"); - //} - - //[Test] - //public void should_not_get_unlimited_pages() - //{ - // var results = Subject.GetSearchRequests(_animeSearchCriteria); - - // results.GetAllTiers().Should().HaveCount(1); - - // var pages = results.GetAllTiers().First().Take(500).ToList(); - - // pages.Count.Should().BeLessThan(500); - //} - - //[Test] - //public void should_not_search_by_rid_if_not_supported() - //{ - // _capabilities.SupportedAudioSearchParameters = new[] { "q", "artist", "album" }; - - // var results = Subject.GetSearchRequests(_singleAlbumSearchCriteria); - - // results.GetAllTiers().Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.Query.Should().NotContain("rid=10"); - // page.Url.Query.Should().Contain("q=Monkey"); - //} - - //[Test] - //public void should_search_by_rid_if_supported() - //{ - // var results = Subject.GetSearchRequests(_singleAlbumSearchCriteria); - // results.GetTier(0).Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.Query.Should().Contain("rid=10"); - //} - - //[Test] - //public void should_not_search_by_tvdbid_if_not_supported() - //{ - // _capabilities.SupportedTvSearchParameters = new[] { "q", "season", "ep" }; - - // var results = Subject.GetSearchRequests(_singleEpisodeSearchCriteria); - // results.GetTier(0).Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.Query.Should().NotContain("rid=10"); - // page.Url.Query.Should().Contain("q=Monkey"); - //} - - //[Test] - //public void should_search_by_tvdbid_if_supported() - //{ - // _capabilities.SupportedTvSearchParameters = new[] { "q", "tvdbid", "season", "ep" }; - - // var results = Subject.GetSearchRequests(_singleEpisodeSearchCriteria); - // results.GetTier(0).Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.Query.Should().Contain("tvdbid=20"); - //} - [Test] public void should_search_by_artist_and_album_if_supported() { @@ -199,93 +80,5 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests page.Url.Query.Should().Contain("artist=Alien Ant Farm"); page.Url.Query.Should().Contain("album=TruANT"); } - - //[Test] - //public void should_search_by_tvmaze_if_supported() - //{ - // _capabilities.SupportedTvSearchParameters = new[] { "q", "tvmazeid", "season", "ep" }; - - // var results = Subject.GetSearchRequests(_singleEpisodeSearchCriteria); - // results.GetTier(0).Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.Query.Should().Contain("tvmazeid=30"); - //} - - //[Test] - //public void should_prefer_search_by_tvdbid_if_rid_supported() - //{ - // _capabilities.SupportedTvSearchParameters = new[] { "q", "tvdbid", "rid", "season", "ep" }; - - // var results = Subject.GetSearchRequests(_singleEpisodeSearchCriteria); - // results.GetTier(0).Should().HaveCount(1); - - // var page = results.GetAllTiers().First().First(); - - // page.Url.Query.Should().Contain("tvdbid=20"); - // page.Url.Query.Should().NotContain("rid=10"); - //} - - //[Test] - //public void should_use_aggregrated_id_search_if_supported() - //{ - // _capabilities.SupportedTvSearchParameters = new[] { "q", "tvdbid", "rid", "season", "ep" }; - // _capabilities.SupportsAggregateIdSearch = true; - - // var results = Subject.GetSearchRequests(_singleEpisodeSearchCriteria); - // results.GetTier(0).Should().HaveCount(1); - - // var page = results.GetTier(0).First().First(); - - // page.Url.Query.Should().Contain("tvdbid=20"); - // page.Url.Query.Should().Contain("rid=10"); - //} - - //[Test] - //public void should_not_use_aggregrated_id_search_if_no_ids_supported() - //{ - // _capabilities.SupportedTvSearchParameters = new[] { "q", "season", "ep" }; - // _capabilities.SupportsAggregateIdSearch = true; // Turns true if indexer supplies supportedParams. - - // var results = Subject.GetSearchRequests(_singleEpisodeSearchCriteria); - // results.Tiers.Should().Be(1); - // results.GetTier(0).Should().HaveCount(1); - - // var page = results.GetTier(0).First().First(); - - // page.Url.Query.Should().Contain("q="); - //} - - //[Test] - //public void should_not_use_aggregrated_id_search_if_no_ids_are_known() - //{ - // _capabilities.SupportedTvSearchParameters = new[] { "q", "rid", "season", "ep" }; - // _capabilities.SupportsAggregateIdSearch = true; // Turns true if indexer supplies supportedParams. - - // _singleEpisodeSearchCriteria.Series.TvRageId = 0; - - // var results = Subject.GetSearchRequests(_singleEpisodeSearchCriteria); - - // var page = results.GetTier(0).First().First(); - - // page.Url.Query.Should().Contain("q="); - //} - - //[Test] - //public void should_fallback_to_q() - //{ - // _capabilities.SupportedAudioSearchParameters = new[] { "q", "artist", "album" }; - // _capabilities.SupportsAggregateIdSearch = true; - - // var results = Subject.GetSearchRequests(_singleAlbumSearchCriteria); - // results.Tiers.Should().Be(2); - - // var pageTier2 = results.GetTier(1).First().First(); - - // pageTier2.Url.Query.Should().NotContain("artist="); - // pageTier2.Url.Query.Should().NotContain("album="); - // pageTier2.Url.Query.Should().Contain("q="); - //} } } diff --git a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index 921e04164..bf6edeb2d 100644 --- a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -285,7 +285,6 @@ namespace NzbDrone.Core.IndexerSearch { var spec = new TSpec(); - album = _albumService.GetAlbum(album.Id); spec.Album = album; spec.Artist = _artistService.GetArtist(album.ArtistId); spec.UserInvokedSearch = userInvokedSearch; diff --git a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvRequestGenerator.cs b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvRequestGenerator.cs index 40eef0424..f4acb8b46 100644 --- a/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/BitMeTv/BitMeTvRequestGenerator.cs @@ -42,12 +42,12 @@ namespace NzbDrone.Core.Indexers.BitMeTv return new IndexerPageableRequestChain(); } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } diff --git a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs index 3f603837e..cba41c02f 100644 --- a/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/BroadcastheNet/BroadcastheNetRequestGenerator.cs @@ -160,12 +160,12 @@ namespace NzbDrone.Core.Indexers.BroadcastheNet return new IndexerPageableRequestChain(); } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } diff --git a/src/NzbDrone.Core/Indexers/Fanzub/FanzubRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Fanzub/FanzubRequestGenerator.cs index 0327d31e5..13a7c1581 100644 --- a/src/NzbDrone.Core/Indexers/Fanzub/FanzubRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Fanzub/FanzubRequestGenerator.cs @@ -60,12 +60,12 @@ namespace NzbDrone.Core.Indexers.Fanzub return new IndexerPageableRequestChain(); } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } diff --git a/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs b/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs index c9a7ba702..ffceb18e9 100644 --- a/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/HDBits/HDBitsRequestGenerator.cs @@ -43,12 +43,12 @@ namespace NzbDrone.Core.Indexers.HDBits return new IndexerPageableRequestChain(); } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } diff --git a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsRequestGenerator.cs b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsRequestGenerator.cs index 20af9f242..39d81423d 100644 --- a/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/IPTorrents/IPTorrentsRequestGenerator.cs @@ -42,12 +42,12 @@ namespace NzbDrone.Core.Indexers.IPTorrents return new IndexerPageableRequestChain(); } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } diff --git a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 3fafa3238..e6017bcfb 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -107,7 +107,9 @@ namespace NzbDrone.Core.Indexers.Newznab } if (capabilities.SupportedAudioSearchParameters != null && - new[] { "artist", "album" }.All(v => capabilities.SupportedAudioSearchParameters.Contains(v))) + new[] {"artist", "album"}.All(v => capabilities.SupportedAudioSearchParameters.Contains(v))) + { + } if (capabilities.SupportedTvSearchParameters != null && new[] { "q", "tvdbid", "rid" }.Any(v => capabilities.SupportedTvSearchParameters.Contains(v)) && diff --git a/src/NzbDrone.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs b/src/NzbDrone.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs index 22f3f0dad..401ea2284 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/NewznabCapabilitiesProvider.cs @@ -124,8 +124,6 @@ namespace NzbDrone.Core.Indexers.Newznab else if (xmlAudioSearch.Attribute("supportedParams") != null) { capabilities.SupportedAudioSearchParameters = xmlAudioSearch.Attribute("supportedParams").Value.Split(','); - - //capabilities.SupportsAggregateIdSearch = true; } } diff --git a/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs index c1487fb28..13e0233ea 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs @@ -195,11 +195,11 @@ namespace NzbDrone.Core.Indexers.Newznab return pageableRequests; } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { var pageableRequests = new IndexerPageableRequestChain(); - AddAudioPageableRequests(pageableRequests, MaxPages, Settings.Categories, searchCriteria, + AddAudioPageableRequests(pageableRequests, string.Format("&artist={0}&album={1}", searchCriteria.Artist.Name, searchCriteria.Album.Title)); @@ -207,11 +207,11 @@ namespace NzbDrone.Core.Indexers.Newznab return pageableRequests; } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { var pageableRequests = new IndexerPageableRequestChain(); - AddAudioPageableRequests(pageableRequests, MaxPages, Settings.Categories, searchCriteria, + AddAudioPageableRequests(pageableRequests, string.Format("&artist={0}", searchCriteria.Artist.Name)); @@ -278,7 +278,7 @@ namespace NzbDrone.Core.Indexers.Newznab } } - private void AddAudioPageableRequests(IndexerPageableRequestChain chain, int maxPages, IEnumerable categories, SearchCriteriaBase searchCriteria, string parameters) + private void AddAudioPageableRequests(IndexerPageableRequestChain chain, string parameters) { if (SupportsAudioSearch) diff --git a/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs index d375fb552..5acc3bc60 100644 --- a/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Nyaa/NyaaRequestGenerator.cs @@ -74,12 +74,12 @@ namespace NzbDrone.Core.Indexers.Nyaa return pageableRequests; } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } diff --git a/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs index b109d2232..04e13b8d0 100644 --- a/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Omgwtfnzbs/OmgwtfnzbsRequestGenerator.cs @@ -88,7 +88,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs return pageableRequests; } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { var pageableRequests = new IndexerPageableRequestChain(); @@ -101,7 +101,7 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs return pageableRequests; } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { var pageableRequests = new IndexerPageableRequestChain(); diff --git a/src/NzbDrone.Core/Indexers/Rarbg/RarbgRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Rarbg/RarbgRequestGenerator.cs index de40bb1fa..e8364d969 100644 --- a/src/NzbDrone.Core/Indexers/Rarbg/RarbgRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Rarbg/RarbgRequestGenerator.cs @@ -77,7 +77,7 @@ namespace NzbDrone.Core.Indexers.Rarbg return pageableRequests; } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { var pageableRequests = new IndexerPageableRequestChain(); @@ -86,7 +86,7 @@ namespace NzbDrone.Core.Indexers.Rarbg return pageableRequests; } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { var pageableRequests = new IndexerPageableRequestChain(); diff --git a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexerRequestGenerator.cs b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexerRequestGenerator.cs index 0995ffdd7..be6088f72 100644 --- a/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexerRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/TorrentRss/TorrentRssIndexerRequestGenerator.cs @@ -43,7 +43,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss return new IndexerPageableRequestChain(); } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } diff --git a/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechRequestGenerator.cs index b676a313c..4edfb6e90 100644 --- a/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Torrentleech/TorrentleechRequestGenerator.cs @@ -42,12 +42,12 @@ namespace NzbDrone.Core.Indexers.Torrentleech return new IndexerPageableRequestChain(); } - public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria) { throw new System.NotImplementedException(); } - public IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) + public virtual IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria) { throw new System.NotImplementedException(); }