Remove TV search commands (#68)

* Remove TV search commands

Remove TV search commands

* Cleanup Newznab, Fix variable name in IntegrationTests
pull/67/merge
Qstick 7 years ago committed by GitHub
parent 92f06cf70f
commit 9fba2458d8

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
@ -85,7 +85,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
[Test]
public void should_return_true_if_it_is_a_search()
{
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, new SeasonSearchCriteria()).Accepted.Should().BeTrue();
_upgradeHistory.IsSatisfiedBy(_parseResultMulti, new AlbumSearchCriteria()).Accepted.Should().BeTrue();
}
[Test]

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
@ -108,34 +108,34 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
public void should_return_true_for_single_album_search()
{
_fakeArtist.Monitored = false;
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new SingleEpisodeSearchCriteria()).Accepted.Should().BeTrue();
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new AlbumSearchCriteria()).Accepted.Should().BeTrue();
}
[Test]
public void should_return_true_if_album_is_monitored_for_season_search()
{
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new SeasonSearchCriteria()).Accepted.Should().BeTrue();
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new AlbumSearchCriteria()).Accepted.Should().BeTrue();
}
[Test]
public void should_return_false_if_album_is_not_monitored_for_season_search()
{
WithFirstAlbumUnmonitored();
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new SeasonSearchCriteria()).Accepted.Should().BeFalse();
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new AlbumSearchCriteria()).Accepted.Should().BeFalse();
}
[Test]
public void should_return_true_if_album_is_not_monitored_and_monitoredEpisodesOnly_flag_is_false()
{
WithFirstAlbumUnmonitored();
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new SingleEpisodeSearchCriteria { MonitoredEpisodesOnly = false }).Accepted.Should().BeTrue();
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new AlbumSearchCriteria { MonitoredEpisodesOnly = false }).Accepted.Should().BeTrue();
}
[Test]
public void should_return_false_if_album_is_not_monitored_and_monitoredEpisodesOnly_flag_is_true()
{
WithFirstAlbumUnmonitored();
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new SingleEpisodeSearchCriteria{ MonitoredEpisodesOnly = true}).Accepted.Should().BeFalse();
_monitoredAlbumSpecification.IsSatisfiedBy(_parseResultSingle, new AlbumSearchCriteria{ MonitoredEpisodesOnly = true}).Accepted.Should().BeFalse();
}
}
}
}

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
@ -118,7 +118,7 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
WithFirstFileUpgradable();
_firstFile.DateAdded = DateTime.Today.AddDays(-30);
Subject.IsSatisfiedBy(_parseResultSingle, new SingleEpisodeSearchCriteria()).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_parseResultSingle, new AlbumSearchCriteria()).Accepted.Should().BeTrue();
}
[Test]
@ -141,4 +141,4 @@ namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
}
}
}
}

@ -1,265 +0,0 @@
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.IndexerSearch;
using NzbDrone.Core.Test.Framework;
using FizzWare.NBuilder;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.IndexerSearch.Definitions;
namespace NzbDrone.Core.Test.IndexerSearchTests
{
public class NzbSearchServiceFixture : CoreTest<NzbSearchService>
{
private Mock<IIndexer> _mockIndexer;
private Series _xemSeries;
private List<Episode> _xemEpisodes;
[SetUp]
public void SetUp()
{
_mockIndexer = Mocker.GetMock<IIndexer>();
_mockIndexer.SetupGet(s => s.Definition).Returns(new IndexerDefinition { Id = 1 });
_mockIndexer.SetupGet(s => s.SupportsSearch).Returns(true);
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.SearchEnabled(true))
.Returns(new List<IIndexer> { _mockIndexer.Object });
Mocker.GetMock<IMakeDownloadDecision>()
.Setup(s => s.GetSearchDecision(It.IsAny<List<Parser.Model.ReleaseInfo>>(), It.IsAny<SearchCriteriaBase>()))
.Returns(new List<DownloadDecision>());
_xemSeries = Builder<Series>.CreateNew()
.With(v => v.UseSceneNumbering = true)
.With(v => v.Monitored = true)
.Build();
_xemEpisodes = new List<Episode>();
Mocker.GetMock<ISeriesService>()
.Setup(v => v.GetSeries(_xemSeries.Id))
.Returns(_xemSeries);
Mocker.GetMock<IEpisodeService>()
.Setup(v => v.GetEpisodesBySeason(_xemSeries.Id, It.IsAny<int>()))
.Returns<int, int>((i, j) => _xemEpisodes.Where(d => d.SeasonNumber == j).ToList());
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.GetSceneNames(It.IsAny<int>(), It.IsAny<List<int>>(), It.IsAny<List<int>>()))
.Returns(new List<string>());
}
private void WithEpisode(int seasonNumber, int episodeNumber, int? sceneSeasonNumber, int? sceneEpisodeNumber)
{
var episode = Builder<Episode>.CreateNew()
.With(v => v.SeriesId == _xemSeries.Id)
.With(v => v.Series == _xemSeries)
.With(v => v.SeasonNumber, seasonNumber)
.With(v => v.EpisodeNumber, episodeNumber)
.With(v => v.SceneSeasonNumber, sceneSeasonNumber)
.With(v => v.SceneEpisodeNumber, sceneEpisodeNumber)
.With(v => v.Monitored = true)
.Build();
_xemEpisodes.Add(episode);
}
private void WithEpisodes()
{
// Season 1 maps to Scene Season 2 (one-to-one)
WithEpisode(1, 12, 2, 3);
WithEpisode(1, 13, 2, 4);
// Season 2 maps to Scene Season 3 & 4 (one-to-one)
WithEpisode(2, 1, 3, 11);
WithEpisode(2, 2, 3, 12);
WithEpisode(2, 3, 4, 11);
WithEpisode(2, 4, 4, 12);
// Season 3 maps to Scene Season 5 (partial)
// Season 4 maps to Scene Season 5 & 6 (partial)
WithEpisode(3, 1, 5, 11);
WithEpisode(3, 2, 5, 12);
WithEpisode(4, 1, 5, 13);
WithEpisode(4, 2, 5, 14);
WithEpisode(4, 3, 6, 11);
WithEpisode(5, 1, 6, 12);
// Season 7+ maps normally, so no mapping specified.
WithEpisode(7, 1, null, null);
WithEpisode(7, 2, null, null);
}
private List<SearchCriteriaBase> WatchForSearchCriteria()
{
var result = new List<SearchCriteriaBase>();
_mockIndexer.Setup(v => v.Fetch(It.IsAny<SingleEpisodeSearchCriteria>()))
.Callback<SingleEpisodeSearchCriteria>(s => result.Add(s))
.Returns(new List<Parser.Model.ReleaseInfo>());
_mockIndexer.Setup(v => v.Fetch(It.IsAny<SeasonSearchCriteria>()))
.Callback<SeasonSearchCriteria>(s => result.Add(s))
.Returns(new List<Parser.Model.ReleaseInfo>());
_mockIndexer.Setup(v => v.Fetch(It.IsAny<AnimeEpisodeSearchCriteria>()))
.Callback<AnimeEpisodeSearchCriteria>(s => result.Add(s))
.Returns(new List<Parser.Model.ReleaseInfo>());
return result;
}
[Test]
public void scene_episodesearch()
{
WithEpisodes();
var allCriteria = WatchForSearchCriteria();
Subject.EpisodeSearch(_xemEpisodes.First(), true);
var criteria = allCriteria.OfType<SingleEpisodeSearchCriteria>().ToList();
criteria.Count.Should().Be(1);
criteria[0].SeasonNumber.Should().Be(2);
criteria[0].EpisodeNumber.Should().Be(3);
}
[Test]
public void scene_seasonsearch()
{
WithEpisodes();
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, 1, false, true);
var criteria = allCriteria.OfType<SeasonSearchCriteria>().ToList();
criteria.Count.Should().Be(1);
criteria[0].SeasonNumber.Should().Be(2);
}
[Test]
public void scene_seasonsearch_should_search_multiple_seasons()
{
WithEpisodes();
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, 2, false, true);
var criteria = allCriteria.OfType<SeasonSearchCriteria>().ToList();
criteria.Count.Should().Be(2);
criteria[0].SeasonNumber.Should().Be(3);
criteria[1].SeasonNumber.Should().Be(4);
}
[Test]
public void scene_seasonsearch_should_search_single_episode_if_possible()
{
WithEpisodes();
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, 4, false, true);
var criteria1 = allCriteria.OfType<SeasonSearchCriteria>().ToList();
var criteria2 = allCriteria.OfType<SingleEpisodeSearchCriteria>().ToList();
criteria1.Count.Should().Be(1);
criteria1[0].SeasonNumber.Should().Be(5);
criteria2.Count.Should().Be(1);
criteria2[0].SeasonNumber.Should().Be(6);
criteria2[0].EpisodeNumber.Should().Be(11);
}
[Test]
public void scene_seasonsearch_should_use_seasonnumber_if_no_scene_number_is_available()
{
WithEpisodes();
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, 7, false, true);
var criteria = allCriteria.OfType<SeasonSearchCriteria>().ToList();
criteria.Count.Should().Be(1);
criteria[0].SeasonNumber.Should().Be(7);
}
[Test]
public void season_search_for_anime_should_search_for_each_monitored_episode()
{
WithEpisodes();
_xemSeries.SeriesType = SeriesTypes.Anime;
_xemEpisodes.ForEach(e => e.EpisodeFileId = 0);
var seasonNumber = 1;
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, seasonNumber, true, true);
var criteria = allCriteria.OfType<AnimeEpisodeSearchCriteria>().ToList();
criteria.Count.Should().Be(_xemEpisodes.Count(e => e.SeasonNumber == seasonNumber));
}
[Test]
public void season_search_for_anime_should_not_search_for_unmonitored_episodes()
{
WithEpisodes();
_xemSeries.SeriesType = SeriesTypes.Anime;
_xemEpisodes.ForEach(e => e.Monitored = false);
_xemEpisodes.ForEach(e => e.EpisodeFileId = 0);
var seasonNumber = 1;
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, seasonNumber, false, true);
var criteria = allCriteria.OfType<AnimeEpisodeSearchCriteria>().ToList();
criteria.Count.Should().Be(0);
}
[Test]
public void season_search_for_anime_should_not_search_for_episodes_with_files()
{
WithEpisodes();
_xemSeries.SeriesType = SeriesTypes.Anime;
_xemEpisodes.ForEach(e => e.EpisodeFileId = 1);
var seasonNumber = 1;
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, seasonNumber, true, true);
var criteria = allCriteria.OfType<AnimeEpisodeSearchCriteria>().ToList();
criteria.Count.Should().Be(0);
}
[Test]
public void getscenenames_should_use_seasonnumber_if_no_scene_seasonnumber_is_available()
{
WithEpisodes();
var allCriteria = WatchForSearchCriteria();
Subject.SeasonSearch(_xemSeries.Id, 7, false, true);
Mocker.GetMock<ISceneMappingService>()
.Verify(v => v.GetSceneNames(_xemSeries.Id, It.Is<List<int>>(l => l.Contains(7)), It.Is<List<int>>(l => l.Contains(7))), Times.Once());
}
}
}

@ -7,7 +7,7 @@ using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.IndexerSearchTests
{
public class SearchDefinitionFixture : CoreTest<SingleEpisodeSearchCriteria>
public class SearchDefinitionFixture : CoreTest<AlbumSearchCriteria>
{
[TestCase("Betty White's Off Their Rockers", "Betty+Whites+Off+Their+Rockers")]
[TestCase("Star Wars: The Clone Wars", "Star+Wars+The+Clone+Wars")]

@ -1,81 +0,0 @@
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download;
using NzbDrone.Core.IndexerSearch;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.Test.IndexerSearchTests
{
[System.Obsolete("Sonarr TV stuff. Not needed in lidarr.")]
[TestFixture]
public class SeriesSearchServiceFixture : CoreTest<SeriesSearchService>
{
private Series _series;
[SetUp]
public void Setup()
{
_series = new Series
{
Id = 1,
Title = "Title",
Seasons = new List<Season>()
};
Mocker.GetMock<ISeriesService>()
.Setup(s => s.GetSeries(It.IsAny<int>()))
.Returns(_series);
Mocker.GetMock<ISearchForNzb>()
.Setup(s => s.SeasonSearch(_series.Id, It.IsAny<int>(), false, true))
.Returns(new List<DownloadDecision>());
Mocker.GetMock<IProcessDownloadDecisions>()
.Setup(s => s.ProcessDecisions(It.IsAny<List<DownloadDecision>>()))
.Returns(new ProcessedDecisions(new List<DownloadDecision>(), new List<DownloadDecision>(), new List<DownloadDecision>()));
}
[Test]
public void should_only_include_monitored_seasons()
{
_series.Seasons = new List<Season>
{
new Season { SeasonNumber = 0, Monitored = false },
new Season { SeasonNumber = 1, Monitored = true }
};
Subject.Execute(new SeriesSearchCommand { SeriesId = _series.Id, Trigger = CommandTrigger.Manual });
Mocker.GetMock<ISearchForNzb>()
.Verify(v => v.SeasonSearch(_series.Id, It.IsAny<int>(), false, true), Times.Exactly(_series.Seasons.Count(s => s.Monitored)));
}
[Test]
public void should_start_with_lower_seasons_first()
{
var seasonOrder = new List<int>();
_series.Seasons = new List<Season>
{
new Season { SeasonNumber = 3, Monitored = true },
new Season { SeasonNumber = 1, Monitored = true },
new Season { SeasonNumber = 2, Monitored = true }
};
Mocker.GetMock<ISearchForNzb>()
.Setup(s => s.SeasonSearch(_series.Id, It.IsAny<int>(), false, true))
.Returns(new List<DownloadDecision>())
.Callback<int, int, bool, bool>((seriesId, seasonNumber, missingOnly, userInvokedSearch) => seasonOrder.Add(seasonNumber));
Subject.Execute(new SeriesSearchCommand { SeriesId = _series.Id, Trigger = CommandTrigger.Manual });
seasonOrder.First().Should().Be(_series.Seasons.OrderBy(s => s.SeasonNumber).First().SeasonNumber);
}
}
}

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
@ -16,26 +16,16 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
[IntegrationTest]
public class IndexerIntegrationTests : CoreTest
{
private SingleEpisodeSearchCriteria _singleSearchCriteria;
private AnimeEpisodeSearchCriteria _animeSearchCriteria;
private AlbumSearchCriteria _albumSearchCriteria;
[SetUp]
public void SetUp()
{
UseRealHttp();
_singleSearchCriteria = new SingleEpisodeSearchCriteria()
_albumSearchCriteria = new AlbumSearchCriteria()
{
SceneTitles = new List<string> { "Person of Interest" },
SeasonNumber = 1,
EpisodeNumber = 1
};
_animeSearchCriteria = new AnimeEpisodeSearchCriteria()
{
SceneTitles = new List<string> { "Steins;Gate" },
AbsoluteEpisodeNumber = 1
};
}
[Test]
@ -65,7 +55,7 @@ namespace NzbDrone.Core.Test.IndexerTests.IntegrationTests
Settings = new NyaaSettings()
};
var result = indexer.Fetch(_animeSearchCriteria);
var result = indexer.Fetch(_albumSearchCriteria);
ValidateTorrentResult(result, hasSize: true);
}

@ -1,92 +0,0 @@
using System.Collections.Generic;
using FizzWare.NBuilder;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Tv;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.IndexerTests
{
[TestFixture]
public class SeasonSearchFixture : TestBase<TestIndexer>
{
private Series _series;
[SetUp]
public void Setup()
{
_series = Builder<Series>.CreateNew().Build();
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), "<xml></xml>"));
}
private void WithIndexer(bool paging, int resultCount)
{
var definition = new IndexerDefinition();
definition.Name = "Test";
Subject.Definition = definition;
Subject._supportedPageSize = paging ? 100 : 0;
var requestGenerator = Mocker.GetMock<IIndexerRequestGenerator>();
Subject._requestGenerator = requestGenerator.Object;
var requests = Builder<IndexerRequest>.CreateListOfSize(paging ? 100 : 1)
.All()
.WithConstructor(() => new IndexerRequest("http://my.feed.local/", HttpAccept.Rss))
.With(v => v.HttpRequest.Method = HttpMethod.GET)
.Build();
var pageable = new IndexerPageableRequestChain();
pageable.Add(requests);
requestGenerator.Setup(s => s.GetSearchRequests(It.IsAny<SeasonSearchCriteria>()))
.Returns(pageable);
var parser = Mocker.GetMock<IParseIndexerResponse>();
Subject._parser = parser.Object;
var results = Builder<ReleaseInfo>.CreateListOfSize(resultCount)
.Build();
parser.Setup(s => s.ParseResponse(It.IsAny<IndexerResponse>()))
.Returns(results);
}
[Test]
public void should_not_use_offset_if_result_count_is_less_than_90()
{
WithIndexer(true, 25);
Subject.Fetch(new SeasonSearchCriteria { Series = _series, SceneTitles = new List<string>{_series.Title} });
Mocker.GetMock<IHttpClient>().Verify(v => v.Execute(It.IsAny<HttpRequest>()), Times.Once());
}
[Test]
public void should_not_use_offset_for_sites_that_do_not_support_it()
{
WithIndexer(false, 125);
Subject.Fetch(new SeasonSearchCriteria { Series = _series, SceneTitles = new List<string> { _series.Title } });
Mocker.GetMock<IHttpClient>().Verify(v => v.Execute(It.IsAny<HttpRequest>()), Times.Once());
}
[Test]
public void should_not_use_offset_if_its_already_tried_10_times()
{
WithIndexer(true, 100);
Subject.Fetch(new SeasonSearchCriteria { Series = _series, SceneTitles = new List<string> { _series.Title } });
Mocker.GetMock<IHttpClient>().Verify(v => v.Execute(It.IsAny<HttpRequest>()), Times.Exactly(10));
}
}
}

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Indexers;
@ -24,17 +24,8 @@ namespace NzbDrone.Core.Test.Messaging.Commands
[Test]
public void should_return_true_when_single_property_matches()
{
var command1 = new EpisodeSearchCommand { EpisodeIds = new List<int>{ 1 } };
var command2 = new EpisodeSearchCommand { EpisodeIds = new List<int> { 1 } };
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeTrue();
}
[Test]
public void should_return_true_when_multiple_properties_match()
{
var command1 = new SeasonSearchCommand { SeriesId = 1, SeasonNumber = 1 };
var command2 = new SeasonSearchCommand { SeriesId = 1, SeasonNumber = 1 };
var command1 = new AlbumSearchCommand { AlbumIds = new List<int>{ 1 } };
var command2 = new AlbumSearchCommand { AlbumIds = new List<int> { 1 } };
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeTrue();
}
@ -42,35 +33,18 @@ namespace NzbDrone.Core.Test.Messaging.Commands
[Test]
public void should_return_false_when_single_property_doesnt_match()
{
var command1 = new EpisodeSearchCommand { EpisodeIds = new List<int> { 1 } };
var command2 = new EpisodeSearchCommand { EpisodeIds = new List<int> { 2 } };
var command1 = new AlbumSearchCommand { AlbumIds = new List<int> { 1 } };
var command2 = new AlbumSearchCommand { AlbumIds = new List<int> { 2 } };
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeFalse();
}
[Test]
public void should_return_false_when_only_one_property_matches()
{
var command1 = new SeasonSearchCommand { SeriesId = 1, SeasonNumber = 1 };
var command2 = new SeasonSearchCommand { SeriesId = 1, SeasonNumber = 2 };
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeFalse();
}
[Test]
public void should_return_false_when_no_properties_match()
{
var command1 = new SeasonSearchCommand { SeriesId = 1, SeasonNumber = 1 };
var command2 = new SeasonSearchCommand { SeriesId = 2, SeasonNumber = 2 };
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeFalse();
}
[Test]
public void should_return_false_when_only_one_has_properties()
{
var command1 = new SeasonSearchCommand();
var command2 = new SeasonSearchCommand { SeriesId = 2, SeasonNumber = 2 };
var command1 = new ArtistSearchCommand();
var command2 = new ArtistSearchCommand { ArtistId = 2};
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeFalse();
}
@ -78,8 +52,8 @@ namespace NzbDrone.Core.Test.Messaging.Commands
[Test]
public void should_return_false_when_only_one_has_null_property()
{
var command1 = new EpisodeSearchCommand(null);
var command2 = new EpisodeSearchCommand(new List<int>());
var command1 = new AlbumSearchCommand(null);
var command2 = new AlbumSearchCommand(new List<int>());
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeFalse();
}
@ -93,8 +67,8 @@ namespace NzbDrone.Core.Test.Messaging.Commands
[Test]
public void should_return_false_when_commands_list_are_different_lengths()
{
var command1 = new EpisodeSearchCommand { EpisodeIds = new List<int> { 1 } };
var command2 = new EpisodeSearchCommand { EpisodeIds = new List<int> { 1, 2 } };
var command1 = new AlbumSearchCommand { AlbumIds = new List<int> { 1 } };
var command2 = new AlbumSearchCommand { AlbumIds = new List<int> { 1, 2 } };
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeFalse();
}
@ -102,8 +76,8 @@ namespace NzbDrone.Core.Test.Messaging.Commands
[Test]
public void should_return_false_when_commands_list_dont_match()
{
var command1 = new EpisodeSearchCommand { EpisodeIds = new List<int> { 1 } };
var command2 = new EpisodeSearchCommand { EpisodeIds = new List<int> { 2 } };
var command1 = new AlbumSearchCommand { AlbumIds = new List<int> { 1 } };
var command2 = new AlbumSearchCommand { AlbumIds = new List<int> { 2 } };
CommandEqualityComparer.Instance.Equals(command1, command2).Should().BeFalse();
}

@ -247,8 +247,6 @@
<Compile Include="Http\HttpProxySettingsProviderFixture.cs" />
<Compile Include="Http\TorCacheHttpRequestInterceptorFixture.cs" />
<Compile Include="IndexerSearchTests\ArtistSearchServiceFixture.cs" />
<Compile Include="IndexerSearchTests\SeriesSearchServiceFixture.cs" />
<Compile Include="IndexerSearchTests\NzbSearchServiceFixture.cs" />
<Compile Include="IndexerSearchTests\SearchDefinitionFixture.cs" />
<Compile Include="IndexerTests\BasicRssParserFixture.cs" />
<Compile Include="IndexerTests\IndexerServiceFixture.cs" />
@ -264,7 +262,6 @@
<Compile Include="IndexerTests\NewznabTests\NewznabSettingFixture.cs" />
<Compile Include="IndexerTests\FanzubTests\FanzubFixture.cs" />
<Compile Include="IndexerTests\OmgwtfnzbsTests\OmgwtfnzbsFixture.cs" />
<Compile Include="IndexerTests\SeasonSearchFixture.cs" />
<Compile Include="IndexerTests\TestIndexer.cs" />
<Compile Include="IndexerTests\TestIndexerSettings.cs" />
<Compile Include="IndexerTests\IPTorrentsTests\IPTorrentsFixture.cs" />
@ -341,9 +338,7 @@
<Compile Include="ParserTests\MultiEpisodeParserFixture.cs" />
<Compile Include="ParserTests\NormalizeTitleFixture.cs" />
<Compile Include="ParserTests\ParserFixture.cs" />
<Compile Include="ParserTests\ParsingServiceTests\GetEpisodesFixture.cs" />
<Compile Include="ParserTests\ParsingServiceTests\GetSeriesFixture.cs" />
<Compile Include="ParserTests\ParsingServiceTests\MapFixture.cs" />
<Compile Include="ParserTests\PathParserFixture.cs" />
<Compile Include="ParserTests\QualityParserFixture.cs" />
<Compile Include="ParserTests\ReleaseGroupParserFixture.cs" />

@ -1,345 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FizzWare.NBuilder;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Tv;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
{
[TestFixture]
public class GetEpisodesFixture : TestBase<ParsingService>
{
private Series _series;
private List<Episode> _episodes;
private ParsedEpisodeInfo _parsedEpisodeInfo;
private SingleEpisodeSearchCriteria _singleEpisodeSearchCriteria;
[SetUp]
public void Setup()
{
_series = Builder<Series>.CreateNew()
.With(s => s.Title = "30 Rock")
.With(s => s.CleanTitle = "rock")
.Build();
_episodes = Builder<Episode>.CreateListOfSize(1)
.All()
.With(e => e.AirDate = DateTime.Today.ToString(Episode.AIR_DATE_FORMAT))
.Build()
.ToList();
_parsedEpisodeInfo = new ParsedEpisodeInfo
{
SeriesTitle = _series.Title,
SeasonNumber = 1,
EpisodeNumbers = new[] { 1 },
AbsoluteEpisodeNumbers = new int[0]
};
_singleEpisodeSearchCriteria = new SingleEpisodeSearchCriteria
{
Series = _series,
EpisodeNumber = _episodes.First().EpisodeNumber,
SeasonNumber = _episodes.First().SeasonNumber,
Episodes = _episodes
};
Mocker.GetMock<ISeriesService>()
.Setup(s => s.FindByTitle(It.IsAny<string>()))
.Returns(_series);
}
private void GivenDailySeries()
{
_series.SeriesType = SeriesTypes.Daily;
}
private void GivenDailyParseResult()
{
_parsedEpisodeInfo.AirDate = DateTime.Today.ToString(Episode.AIR_DATE_FORMAT);
}
private void GivenSceneNumberingSeries()
{
_series.UseSceneNumbering = true;
}
private void GivenAbsoluteNumberingSeries()
{
_parsedEpisodeInfo.AbsoluteEpisodeNumbers = new[] { 1 };
}
[Test]
public void should_get_daily_episode_episode_when_search_criteria_is_null()
{
GivenDailySeries();
GivenDailyParseResult();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), It.IsAny<string>()), Times.Once());
}
[Test]
public void should_use_search_criteria_episode_when_it_matches_daily()
{
GivenDailySeries();
GivenDailyParseResult();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), It.IsAny<string>()), Times.Never());
}
[Test]
public void should_fallback_to_daily_episode_lookup_when_search_criteria_episode_doesnt_match()
{
GivenDailySeries();
_parsedEpisodeInfo.AirDate = DateTime.Today.AddDays(-5).ToString(Episode.AIR_DATE_FORMAT); ;
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), It.IsAny<string>()), Times.Once());
}
[Test]
public void should_use_search_criteria_episode_when_it_matches_absolute()
{
GivenAbsoluteNumberingSeries();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), It.IsAny<string>()), Times.Never());
}
[Test]
public void should_use_scene_numbering_when_series_uses_scene_numbering()
{
GivenSceneNumberingSeries();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>()), Times.Once());
}
[Test]
public void should_match_search_criteria_by_scene_numbering()
{
GivenSceneNumberingSeries();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>()), Times.Never());
}
[Test]
public void should_fallback_to_findEpisode_when_search_criteria_match_fails_for_scene_numbering()
{
GivenSceneNumberingSeries();
_episodes.First().SceneEpisodeNumber = 10;
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>()), Times.Once());
}
[Test]
public void should_find_episode()
{
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>()), Times.Once());
}
[Test]
public void should_match_episode_with_search_criteria()
{
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>()), Times.Never());
}
[Test]
public void should_fallback_to_findEpisode_when_search_criteria_match_fails()
{
_episodes.First().EpisodeNumber = 10;
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), It.IsAny<int>(), It.IsAny<int>()), Times.Once());
}
[Test]
public void should_look_for_episode_in_season_zero_if_absolute_special()
{
GivenAbsoluteNumberingSeries();
_parsedEpisodeInfo.Special = true;
Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny<int>(), 0, It.IsAny<int>()), Times.Never());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), 0, It.IsAny<int>()), Times.Once());
}
[TestCase(0)]
[TestCase(1)]
[TestCase(2)]
public void should_use_scene_numbering_when_scene_season_number_has_value(int seasonNumber)
{
GivenAbsoluteNumberingSeries();
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.GetSceneSeasonNumber(_parsedEpisodeInfo.SeriesTitle))
.Returns(seasonNumber);
Mocker.GetMock<IEpisodeService>()
.Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny<int>(), seasonNumber, It.IsAny<int>()))
.Returns(new List<Episode>());
Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny<int>(), seasonNumber, It.IsAny<int>()), Times.Once());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), seasonNumber, It.IsAny<int>()), Times.Once());
}
[TestCase(0)]
[TestCase(1)]
[TestCase(2)]
public void should_find_episode_by_season_and_scene_absolute_episode_number(int seasonNumber)
{
GivenAbsoluteNumberingSeries();
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.GetSceneSeasonNumber(_parsedEpisodeInfo.SeriesTitle))
.Returns(seasonNumber);
Mocker.GetMock<IEpisodeService>()
.Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny<int>(), seasonNumber, It.IsAny<int>()))
.Returns(new List<Episode> { _episodes.First() });
Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny<int>(), seasonNumber, It.IsAny<int>()), Times.Once());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), seasonNumber, It.IsAny<int>()), Times.Never());
}
[TestCase(0)]
[TestCase(1)]
[TestCase(2)]
public void should_find_episode_by_season_and_absolute_episode_number_when_scene_absolute_episode_number_returns_multiple_results(int seasonNumber)
{
GivenAbsoluteNumberingSeries();
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.GetSceneSeasonNumber(_parsedEpisodeInfo.SeriesTitle))
.Returns(seasonNumber);
Mocker.GetMock<IEpisodeService>()
.Setup(s => s.FindEpisodesBySceneNumbering(It.IsAny<int>(), seasonNumber, It.IsAny<int>()))
.Returns(Builder<Episode>.CreateListOfSize(5).Build().ToList());
Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisodesBySceneNumbering(It.IsAny<int>(), seasonNumber, It.IsAny<int>()), Times.Once());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(It.IsAny<int>(), seasonNumber, It.IsAny<int>()), Times.Once());
}
[Test]
public void should_use_tvdb_season_number_when_available_and_a_scene_source()
{
const int tvdbSeasonNumber = 5;
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.FindSceneMapping(_parsedEpisodeInfo.SeriesTitle))
.Returns(new SceneMapping { SeasonNumber = tvdbSeasonNumber, SceneSeasonNumber = _parsedEpisodeInfo.SeasonNumber });
Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(_series.Id, _parsedEpisodeInfo.SeasonNumber, _parsedEpisodeInfo.EpisodeNumbers.First()), Times.Never());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(_series.Id, tvdbSeasonNumber, _parsedEpisodeInfo.EpisodeNumbers.First()), Times.Once());
}
[Test]
public void should_not_use_tvdb_season_number_when_available_for_a_different_season_and_a_scene_source()
{
const int tvdbSeasonNumber = 5;
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.FindSceneMapping(_parsedEpisodeInfo.SeriesTitle))
.Returns(new SceneMapping { SeasonNumber = tvdbSeasonNumber, SceneSeasonNumber = _parsedEpisodeInfo.SeasonNumber + 100 });
Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(_series.Id, tvdbSeasonNumber, _parsedEpisodeInfo.EpisodeNumbers.First()), Times.Never());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(_series.Id, _parsedEpisodeInfo.SeasonNumber, _parsedEpisodeInfo.EpisodeNumbers.First()), Times.Once());
}
[Test]
public void should_not_use_tvdb_season_when_not_a_scene_source()
{
const int tvdbSeasonNumber = 5;
Subject.GetEpisodes(_parsedEpisodeInfo, _series, false, null);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(_series.Id, tvdbSeasonNumber, _parsedEpisodeInfo.EpisodeNumbers.First()), Times.Never());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(_series.Id, _parsedEpisodeInfo.SeasonNumber, _parsedEpisodeInfo.EpisodeNumbers.First()), Times.Once());
}
[Test]
public void should_not_use_tvdb_season_when_tvdb_season_number_is_less_than_zero()
{
const int tvdbSeasonNumber = -1;
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.FindSceneMapping(_parsedEpisodeInfo.SeriesTitle))
.Returns(new SceneMapping { SeasonNumber = tvdbSeasonNumber, SceneSeasonNumber = _parsedEpisodeInfo.SeasonNumber });
Subject.GetEpisodes(_parsedEpisodeInfo, _series, true, null);
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(_series.Id, tvdbSeasonNumber, _parsedEpisodeInfo.EpisodeNumbers.First()), Times.Never());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.FindEpisode(_series.Id, _parsedEpisodeInfo.SeasonNumber, _parsedEpisodeInfo.EpisodeNumbers.First()), Times.Once());
}
}
}

@ -1,222 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Tv;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
{
[TestFixture]
public class MapFixture : TestBase<ParsingService>
{
private Series _series;
private List<Episode> _episodes;
private ParsedEpisodeInfo _parsedEpisodeInfo;
private SingleEpisodeSearchCriteria _singleEpisodeSearchCriteria;
[SetUp]
public void Setup()
{
_series = Builder<Series>.CreateNew()
.With(s => s.Title = "30 Rock")
.With(s => s.CleanTitle = "rock")
.Build();
_episodes = Builder<Episode>.CreateListOfSize(1)
.All()
.With(e => e.AirDate = DateTime.Today.ToString(Episode.AIR_DATE_FORMAT))
.Build()
.ToList();
_parsedEpisodeInfo = new ParsedEpisodeInfo
{
SeriesTitle = _series.Title,
SeriesTitleInfo = new SeriesTitleInfo(),
SeasonNumber = 1,
EpisodeNumbers = new[] { 1 }
};
_singleEpisodeSearchCriteria = new SingleEpisodeSearchCriteria
{
Series = _series,
EpisodeNumber = _episodes.First().EpisodeNumber,
SeasonNumber = _episodes.First().SeasonNumber,
Episodes = _episodes
};
}
private void GivenMatchBySeriesTitle()
{
Mocker.GetMock<ISeriesService>()
.Setup(s => s.FindByTitle(It.IsAny<string>()))
.Returns(_series);
}
private void GivenMatchByTvdbId()
{
Mocker.GetMock<ISeriesService>()
.Setup(s => s.FindByTvdbId(It.IsAny<Int32>()))
.Returns(_series);
}
private void GivenMatchByTvRageId()
{
Mocker.GetMock<ISeriesService>()
.Setup(s => s.FindByTvRageId(It.IsAny<int>()))
.Returns(_series);
}
private void GivenParseResultSeriesDoesntMatchSearchCriteria()
{
_parsedEpisodeInfo.SeriesTitle = "Another Name";
}
[Test]
public void should_lookup_series_by_name()
{
GivenMatchBySeriesTitle();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTitle(It.IsAny<string>()), Times.Once());
}
[Test]
public void should_use_tvdbid_when_series_title_lookup_fails()
{
GivenMatchByTvdbId();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTvdbId(It.IsAny<Int32>()), Times.Once());
}
[Test]
public void should_use_tvrageid_when_series_title_lookup_fails()
{
GivenMatchByTvRageId();
Subject.Map(_parsedEpisodeInfo, 0, _series.TvRageId);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTvRageId(It.IsAny<int>()), Times.Once());
}
[Test]
public void should_not_use_tvrageid_when_scene_naming_exception_exists()
{
GivenMatchByTvRageId();
Mocker.GetMock<ISceneMappingService>()
.Setup(v => v.FindTvdbId(It.IsAny<string>()))
.Returns(10);
var result = Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTvRageId(It.IsAny<int>()), Times.Never());
result.Series.Should().BeNull();
}
[Test]
public void should_use_search_criteria_series_title()
{
GivenMatchBySeriesTitle();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTitle(It.IsAny<string>()), Times.Never());
}
[Test]
public void should_FindByTitle_when_search_criteria_matching_fails()
{
GivenParseResultSeriesDoesntMatchSearchCriteria();
Subject.Map(_parsedEpisodeInfo, 10, 10, _singleEpisodeSearchCriteria);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTitle(It.IsAny<string>()), Times.Once());
}
[Test]
public void should_FindByTitle_using_year_when_FindByTitle_matching_fails()
{
GivenParseResultSeriesDoesntMatchSearchCriteria();
_parsedEpisodeInfo.SeriesTitleInfo = new SeriesTitleInfo
{
Title = "Series Title 2017",
TitleWithoutYear = "Series Title",
Year = 2017
};
Mocker.GetMock<ISeriesService>()
.Setup(s => s.FindByTitle(_parsedEpisodeInfo.SeriesTitleInfo.TitleWithoutYear, _parsedEpisodeInfo.SeriesTitleInfo.Year))
.Returns(_series);
Subject.Map(_parsedEpisodeInfo, 10, 10, _singleEpisodeSearchCriteria);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTitle(It.IsAny<string>(), It.IsAny<int>()), Times.Once());
}
[Test]
public void should_FindByTvdbId_when_search_criteria_and_FindByTitle_matching_fails()
{
GivenParseResultSeriesDoesntMatchSearchCriteria();
Subject.Map(_parsedEpisodeInfo, 10, 10, _singleEpisodeSearchCriteria);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTvdbId(It.IsAny<Int32>()), Times.Once());
}
[Test]
public void should_FindByTvRageId_when_search_criteria_and_FindByTitle_matching_fails()
{
GivenParseResultSeriesDoesntMatchSearchCriteria();
Subject.Map(_parsedEpisodeInfo, 10, 10, _singleEpisodeSearchCriteria);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTvRageId(It.IsAny<int>()), Times.Once());
}
[Test]
public void should_use_tvdbid_matching_when_alias_is_found()
{
Mocker.GetMock<ISceneMappingService>()
.Setup(s => s.FindTvdbId(It.IsAny<string>()))
.Returns(_series.TvdbId);
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTitle(It.IsAny<string>()), Times.Never());
}
[Test]
public void should_use_tvrageid_match_from_search_criteria_when_title_match_fails()
{
GivenParseResultSeriesDoesntMatchSearchCriteria();
Subject.Map(_parsedEpisodeInfo, _series.TvdbId, _series.TvRageId, _singleEpisodeSearchCriteria);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.FindByTitle(It.IsAny<string>()), Times.Never());
}
}
}

@ -1,12 +0,0 @@
namespace NzbDrone.Core.IndexerSearch.Definitions
{
public class AnimeEpisodeSearchCriteria : SearchCriteriaBase
{
public int AbsoluteEpisodeNumber { get; set; }
public override string ToString()
{
return string.Format("[{0} : {1:00}]", Series.Title, AbsoluteEpisodeNumber);
}
}
}

@ -1,14 +0,0 @@
using System;
namespace NzbDrone.Core.IndexerSearch.Definitions
{
public class DailyEpisodeSearchCriteria : SearchCriteriaBase
{
public DateTime AirDate { get; set; }
public override string ToString()
{
return string.Format("[{0} : {1:yyyy-MM-dd}", Series.Title, AirDate);
}
}
}

@ -1,14 +0,0 @@
namespace NzbDrone.Core.IndexerSearch.Definitions
{
public class SeasonSearchCriteria : SearchCriteriaBase
{
public int SeasonNumber { get; set; }
public override bool MonitoredEpisodesOnly => true;
public override string ToString()
{
return string.Format("[{0} : S{1:00}]", Series.Title, SeasonNumber);
}
}
}

@ -1,13 +0,0 @@
namespace NzbDrone.Core.IndexerSearch.Definitions
{
public class SingleEpisodeSearchCriteria : SearchCriteriaBase
{
public int EpisodeNumber { get; set; }
public int SeasonNumber { get; set; }
public override string ToString()
{
return string.Format("[{0} : S{1:00}E{2:00}]", Series.Title, SeasonNumber, EpisodeNumber);
}
}
}

@ -1,21 +0,0 @@
using System.Linq;
namespace NzbDrone.Core.IndexerSearch.Definitions
{
public class SpecialEpisodeSearchCriteria : SearchCriteriaBase
{
public string[] EpisodeQueryTitles { get; set; }
public override string ToString()
{
var episodeTitles = EpisodeQueryTitles.ToList();
if (episodeTitles.Count > 0)
{
return string.Format("[{0}] Specials", Series.Title);
}
return string.Format("[{0} : {1}]", Series.Title, string.Join(",", EpisodeQueryTitles));
}
}
}

@ -1,21 +0,0 @@
using System.Collections.Generic;
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.IndexerSearch
{
public class EpisodeSearchCommand : Command
{
public List<int> EpisodeIds { get; set; }
public override bool SendUpdatesToClient => true;
public EpisodeSearchCommand()
{
}
public EpisodeSearchCommand(List<int> episodeIds)
{
EpisodeIds = episodeIds;
}
}
}

@ -1,129 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NLog;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Queue;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.IndexerSearch
{
public class EpisodeSearchService : IExecute<EpisodeSearchCommand>, IExecute<MissingEpisodeSearchCommand>
{
private readonly ISearchForNzb _nzbSearchService;
private readonly IProcessDownloadDecisions _processDownloadDecisions;
private readonly IEpisodeService _episodeService;
private readonly IQueueService _queueService;
private readonly Logger _logger;
public EpisodeSearchService(ISearchForNzb nzbSearchService,
IProcessDownloadDecisions processDownloadDecisions,
IEpisodeService episodeService,
IQueueService queueService,
Logger logger)
{
_nzbSearchService = nzbSearchService;
_processDownloadDecisions = processDownloadDecisions;
_episodeService = episodeService;
_queueService = queueService;
_logger = logger;
}
private void SearchForMissingEpisodes(List<Episode> episodes, bool userInvokedSearch)
{
_logger.ProgressInfo("Performing missing search for {0} episodes", episodes.Count);
var downloadedCount = 0;
foreach (var series in episodes.GroupBy(e => e.SeriesId))
{
foreach (var season in series.Select(e => e).GroupBy(e => e.SeasonNumber))
{
List<DownloadDecision> decisions;
if (season.Count() > 1)
{
try
{
decisions = _nzbSearchService.SeasonSearch(series.Key, season.Key, true, userInvokedSearch);
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to search for missing episodes in season {0} of [{1}]", season.Key, series.Key);
continue;
}
}
else
{
try
{
decisions = _nzbSearchService.EpisodeSearch(season.First(), userInvokedSearch);
}
catch (Exception ex)
{
_logger.Error(ex, "Unable to search for missing episode: [{0}]", season.First());
continue;
}
}
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
downloadedCount += processed.Grabbed.Count;
}
}
_logger.ProgressInfo("Completed missing search for {0} episodes. {1} reports downloaded.", episodes.Count, downloadedCount);
}
public void Execute(EpisodeSearchCommand message)
{
foreach (var episodeId in message.EpisodeIds)
{
var decisions = _nzbSearchService.EpisodeSearch(episodeId, message.Trigger == CommandTrigger.Manual);
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
_logger.ProgressInfo("Episode search completed. {0} reports downloaded.", processed.Grabbed.Count);
}
}
public void Execute(MissingEpisodeSearchCommand message)
{
List<Episode> episodes;
if (message.SeriesId.HasValue)
{
episodes = _episodeService.GetEpisodeBySeries(message.SeriesId.Value)
.Where(e => e.Monitored &&
!e.HasFile &&
e.AirDateUtc.HasValue &&
e.AirDateUtc.Value.Before(DateTime.UtcNow))
.ToList();
}
else
{
episodes = _episodeService.EpisodesWithoutFiles(new PagingSpec<Episode>
{
Page = 1,
PageSize = 100000,
SortDirection = SortDirection.Ascending,
SortKey = "Id",
FilterExpression =
v =>
v.Monitored == true &&
v.Series.Monitored == true
}).Records.ToList();
}
var queue = _queueService.GetQueue().Select(q => q.Episode.Id);
var missing = episodes.Where(e => !queue.Contains(e.Id)).ToList();
SearchForMissingEpisodes(missing, message.Trigger == CommandTrigger.Manual);
}
}
}

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading.Tasks;
@ -18,9 +18,6 @@ namespace NzbDrone.Core.IndexerSearch
{
public interface ISearchForNzb
{
List<DownloadDecision> EpisodeSearch(int episodeId, bool userInvokedSearch);
List<DownloadDecision> EpisodeSearch(Episode episode, bool userInvokedSearch);
List<DownloadDecision> SeasonSearch(int seriesId, int seasonNumber, bool missingOnly, bool userInvokedSearch);
List<DownloadDecision> AlbumSearch(int albumId, bool missingOnly, bool userInvokedSearch);
List<DownloadDecision> ArtistSearch(int artistId, bool missingOnly, bool userInvokedSearch);
}
@ -28,146 +25,24 @@ namespace NzbDrone.Core.IndexerSearch
public class NzbSearchService : ISearchForNzb
{
private readonly IIndexerFactory _indexerFactory;
[System.Obsolete("Used for sonarr, not lidarr")]
private readonly ISeriesService _seriesService;
[System.Obsolete("Used for sonarr, not lidarr")]
private readonly IEpisodeService _episodeService;
private readonly IAlbumService _albumService;
private readonly IArtistService _artistService;
private readonly IMakeDownloadDecision _makeDownloadDecision;
private readonly Logger _logger;
public NzbSearchService(IIndexerFactory indexerFactory,
ISeriesService seriesService,
IEpisodeService episodeService,
IAlbumService albumService,
IArtistService artistService,
IMakeDownloadDecision makeDownloadDecision,
Logger logger)
{
_indexerFactory = indexerFactory;
//_sceneMapping = sceneMapping;
_seriesService = seriesService;
_episodeService = episodeService;
_albumService = albumService;
_artistService = artistService;
_makeDownloadDecision = makeDownloadDecision;
_logger = logger;
}
public List<DownloadDecision> EpisodeSearch(int episodeId, bool userInvokedSearch)
{
var episode = _episodeService.GetEpisode(episodeId);
return EpisodeSearch(episode, userInvokedSearch);
}
public List<DownloadDecision> EpisodeSearch(Episode episode, bool userInvokedSearch)
{
var series = _seriesService.GetSeries(episode.SeriesId);
if (series.SeriesType == SeriesTypes.Daily)
{
if (string.IsNullOrWhiteSpace(episode.AirDate))
{
throw new InvalidOperationException("Daily episode is missing AirDate. Try to refresh series info.");
}
return SearchDaily(series, episode, userInvokedSearch);
}
if (series.SeriesType == SeriesTypes.Anime)
{
return SearchAnime(series, episode, userInvokedSearch);
}
if (episode.SeasonNumber == 0)
{
// search for special episodes in season 0
return SearchSpecial(series, new List<Episode> { episode }, userInvokedSearch);
}
return SearchSingle(series, episode, userInvokedSearch);
}
public List<DownloadDecision> SeasonSearch(int seriesId, int seasonNumber, bool missingOnly, bool userInvokedSearch)
{
var series = _seriesService.GetSeries(seriesId);
var episodes = _episodeService.GetEpisodesBySeason(seriesId, seasonNumber);
if (missingOnly)
{
episodes = episodes.Where(e => e.Monitored && !e.HasFile).ToList();
}
if (series.SeriesType == SeriesTypes.Anime)
{
return SearchAnimeSeason(series, episodes, userInvokedSearch);
}
if (seasonNumber == 0)
{
// search for special episodes in season 0
return SearchSpecial(series, episodes, userInvokedSearch);
}
var downloadDecisions = new List<DownloadDecision>();
if (series.UseSceneNumbering)
{
var sceneSeasonGroups = episodes.GroupBy(v =>
{
if (v.SceneSeasonNumber.HasValue && v.SceneEpisodeNumber.HasValue)
{
return v.SceneSeasonNumber.Value;
}
return v.SeasonNumber;
}).Distinct();
foreach (var sceneSeasonEpisodes in sceneSeasonGroups)
{
if (sceneSeasonEpisodes.Count() == 1)
{
var episode = sceneSeasonEpisodes.First();
var searchSpec = Get<SingleEpisodeSearchCriteria>(series, sceneSeasonEpisodes.ToList(), userInvokedSearch);
searchSpec.SeasonNumber = sceneSeasonEpisodes.Key;
searchSpec.MonitoredEpisodesOnly = true;
if (episode.SceneSeasonNumber.HasValue && episode.SceneEpisodeNumber.HasValue)
{
searchSpec.EpisodeNumber = episode.SceneEpisodeNumber.Value;
}
else
{
searchSpec.EpisodeNumber = episode.EpisodeNumber;
}
var decisions = Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
downloadDecisions.AddRange(decisions);
}
else
{
var searchSpec = Get<SeasonSearchCriteria>(series, sceneSeasonEpisodes.ToList(), userInvokedSearch);
searchSpec.SeasonNumber = sceneSeasonEpisodes.Key;
var decisions = Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
downloadDecisions.AddRange(decisions);
}
}
}
else
{
var searchSpec = Get<SeasonSearchCriteria>(series, episodes, userInvokedSearch);
searchSpec.SeasonNumber = seasonNumber;
var decisions = Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
downloadDecisions.AddRange(decisions);
}
return downloadDecisions;
}
public List<DownloadDecision> AlbumSearch(int albumId, bool missingOnly, bool userInvokedSearch)
{
var album = _albumService.GetAlbum(albumId);
@ -205,93 +80,6 @@ namespace NzbDrone.Core.IndexerSearch
return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
}
private List<DownloadDecision> SearchSingle(Series series, Episode episode, bool userInvokedSearch)
{
var searchSpec = Get<SingleEpisodeSearchCriteria>(series, new List<Episode> { episode }, userInvokedSearch);
if (series.UseSceneNumbering && episode.SceneSeasonNumber.HasValue && episode.SceneEpisodeNumber.HasValue)
{
searchSpec.EpisodeNumber = episode.SceneEpisodeNumber.Value;
searchSpec.SeasonNumber = episode.SceneSeasonNumber.Value;
}
else
{
searchSpec.EpisodeNumber = episode.EpisodeNumber;
searchSpec.SeasonNumber = episode.SeasonNumber;
}
return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
}
private List<DownloadDecision> SearchDaily(Series series, Episode episode, bool userInvokedSearch)
{
var airDate = DateTime.ParseExact(episode.AirDate, Episode.AIR_DATE_FORMAT, CultureInfo.InvariantCulture);
var searchSpec = Get<DailyEpisodeSearchCriteria>(series, new List<Episode> { episode }, userInvokedSearch);
searchSpec.AirDate = airDate;
return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
}
private List<DownloadDecision> SearchAnime(Series series, Episode episode, bool userInvokedSearch)
{
var searchSpec = Get<AnimeEpisodeSearchCriteria>(series, new List<Episode> { episode }, userInvokedSearch);
if (episode.SceneAbsoluteEpisodeNumber.HasValue)
{
searchSpec.AbsoluteEpisodeNumber = episode.SceneAbsoluteEpisodeNumber.Value;
}
else if (episode.AbsoluteEpisodeNumber.HasValue)
{
searchSpec.AbsoluteEpisodeNumber = episode.AbsoluteEpisodeNumber.Value;
}
else
{
throw new ArgumentOutOfRangeException("AbsoluteEpisodeNumber", "Can not search for an episode without an absolute episode number");
}
return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
}
private List<DownloadDecision> SearchSpecial(Series series, List<Episode> episodes, bool userInvokedSearch)
{
var searchSpec = Get<SpecialEpisodeSearchCriteria>(series, episodes, userInvokedSearch);
// build list of queries for each episode in the form: "<series> <episode-title>"
searchSpec.EpisodeQueryTitles = episodes.Where(e => !string.IsNullOrWhiteSpace(e.Title))
.SelectMany(e => searchSpec.QueryTitles.Select(title => title + " " + SearchCriteriaBase.GetQueryTitle(e.Title)))
.ToArray();
return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec);
}
private List<DownloadDecision> SearchAnimeSeason(Series series, List<Episode> episodes, bool userInvokedSearch)
{
var downloadDecisions = new List<DownloadDecision>();
foreach (var episode in episodes.Where(e => e.Monitored))
{
downloadDecisions.AddRange(SearchAnime(series, episode, userInvokedSearch));
}
return downloadDecisions;
}
private TSpec Get<TSpec>(Series series, List<Episode> episodes, bool userInvokedSearch) where TSpec : SearchCriteriaBase, new()
{
var spec = new TSpec();
spec.Series = series;
// spec.SceneTitles = _sceneMapping.GetSceneNames(series.TvdbId,
// episodes.Select(e => e.SeasonNumber).Distinct().ToList(),
// episodes.Select(e => e.SceneSeasonNumber ?? e.SeasonNumber).Distinct().ToList());
spec.Episodes = episodes;
spec.SceneTitles.Add(series.Title);
spec.UserInvokedSearch = userInvokedSearch;
return spec;
}
private TSpec Get<TSpec>(Artist artist, List<Album> albums, bool userInvokedSearch) where TSpec : SearchCriteriaBase, new()
{
var spec = new TSpec();

@ -1,12 +0,0 @@
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.IndexerSearch
{
public class SeasonSearchCommand : Command
{
public int SeriesId { get; set; }
public int SeasonNumber { get; set; }
public override bool SendUpdatesToClient => true;
}
}

@ -1,31 +0,0 @@
using NLog;
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Core.Download;
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.IndexerSearch
{
public class SeasonSearchService : IExecute<SeasonSearchCommand>
{
private readonly ISearchForNzb _nzbSearchService;
private readonly IProcessDownloadDecisions _processDownloadDecisions;
private readonly Logger _logger;
public SeasonSearchService(ISearchForNzb nzbSearchService,
IProcessDownloadDecisions processDownloadDecisions,
Logger logger)
{
_nzbSearchService = nzbSearchService;
_processDownloadDecisions = processDownloadDecisions;
_logger = logger;
}
public void Execute(SeasonSearchCommand message)
{
var decisions = _nzbSearchService.SeasonSearch(message.SeriesId, message.SeasonNumber, false, message.Trigger == CommandTrigger.Manual);
var processed = _processDownloadDecisions.ProcessDecisions(decisions);
_logger.ProgressInfo("Season search completed. {0} reports downloaded.", processed.Grabbed.Count);
}
}
}

@ -1,11 +0,0 @@
using NzbDrone.Core.Messaging.Commands;
namespace NzbDrone.Core.IndexerSearch
{
public class SeriesSearchCommand : Command
{
public int SeriesId { get; set; }
public override bool SendUpdatesToClient => true;
}
}

@ -1,49 +0,0 @@
using System.Linq;
using NLog;
using NzbDrone.Common.Instrumentation.Extensions;
using NzbDrone.Core.Download;
using NzbDrone.Core.Messaging.Commands;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.IndexerSearch
{
public class SeriesSearchService : IExecute<SeriesSearchCommand>
{
private readonly ISeriesService _seriesService;
private readonly ISearchForNzb _nzbSearchService;
private readonly IProcessDownloadDecisions _processDownloadDecisions;
private readonly Logger _logger;
public SeriesSearchService(ISeriesService seriesService,
ISearchForNzb nzbSearchService,
IProcessDownloadDecisions processDownloadDecisions,
Logger logger)
{
_seriesService = seriesService;
_nzbSearchService = nzbSearchService;
_processDownloadDecisions = processDownloadDecisions;
_logger = logger;
}
public void Execute(SeriesSearchCommand message)
{
var series = _seriesService.GetSeries(message.SeriesId);
var downloadedCount = 0;
foreach (var season in series.Seasons.OrderBy(s => s.SeasonNumber))
{
if (!season.Monitored)
{
_logger.Debug("Season {0} of {1} is not monitored, skipping search", season.SeasonNumber, series.Title);
continue;
}
var decisions = _nzbSearchService.SeasonSearch(message.SeriesId, season.SeasonNumber, false, message.Trigger == CommandTrigger.Manual);
downloadedCount += _processDownloadDecisions.ProcessDecisions(decisions).Grabbed.Count;
}
_logger.ProgressInfo("Series search completed. {0} reports downloaded.", downloadedCount);
}
}
}

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
@ -29,37 +29,6 @@ namespace NzbDrone.Core.Indexers.Fanzub
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
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;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
throw new System.NotImplementedException();

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
@ -51,71 +51,6 @@ namespace NzbDrone.Core.Indexers
return FetchReleases(generator.GetRecentRequests(), true);
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public override IList<ReleaseInfo> Fetch(SingleEpisodeSearchCriteria searchCriteria)
{
if (!SupportsSearch)
{
return new List<ReleaseInfo>();
}
var generator = GetRequestGenerator();
return FetchReleases(generator.GetSearchRequests(searchCriteria));
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public override IList<ReleaseInfo> Fetch(SeasonSearchCriteria searchCriteria)
{
if (!SupportsSearch)
{
return new List<ReleaseInfo>();
}
var generator = GetRequestGenerator();
return FetchReleases(generator.GetSearchRequests(searchCriteria));
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public override IList<ReleaseInfo> Fetch(DailyEpisodeSearchCriteria searchCriteria)
{
if (!SupportsSearch)
{
return new List<ReleaseInfo>();
}
var generator = GetRequestGenerator();
return FetchReleases(generator.GetSearchRequests(searchCriteria));
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public override IList<ReleaseInfo> Fetch(AnimeEpisodeSearchCriteria searchCriteria)
{
if (!SupportsSearch)
{
return new List<ReleaseInfo>();
}
var generator = GetRequestGenerator();
return FetchReleases(generator.GetSearchRequests(searchCriteria));
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public override IList<ReleaseInfo> Fetch(SpecialEpisodeSearchCriteria searchCriteria)
{
if (!SupportsSearch)
{
return new List<ReleaseInfo>();
}
var generator = GetRequestGenerator();
return FetchReleases(generator.GetSearchRequests(searchCriteria));
}
public override IList<ReleaseInfo> Fetch(AlbumSearchCriteria searchCriteria)
{
if (!SupportsSearch)

@ -12,17 +12,7 @@ namespace NzbDrone.Core.Indexers
DownloadProtocol Protocol { get; }
IList<ReleaseInfo> FetchRecent();
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
IList<ReleaseInfo> Fetch(SeasonSearchCriteria searchCriteria);
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
IList<ReleaseInfo> Fetch(SingleEpisodeSearchCriteria searchCriteria);
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
IList<ReleaseInfo> Fetch(DailyEpisodeSearchCriteria searchCriteria);
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
IList<ReleaseInfo> Fetch(AnimeEpisodeSearchCriteria searchCriteria);
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
IList<ReleaseInfo> Fetch(SpecialEpisodeSearchCriteria searchCriteria);
IList<ReleaseInfo> Fetch(AlbumSearchCriteria searchCriteria);
IList<ReleaseInfo> Fetch(ArtistSearchCriteria searchCriteria);
}
}
}

@ -1,16 +1,11 @@
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.IndexerSearch.Definitions;
namespace NzbDrone.Core.Indexers
{
public interface IIndexerRequestGenerator
{
IndexerPageableRequestChain GetRecentRequests();
IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria);
IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria);
IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria);
IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria);
IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria);
IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria);
IndexerPageableRequestChain GetSearchRequests(ArtistSearchCriteria searchCriteria);
}
}
}

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
@ -17,31 +17,6 @@ namespace NzbDrone.Core.Indexers.IPTorrents
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
throw new System.NotImplementedException();

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using FluentValidation.Results;
@ -63,16 +63,6 @@ namespace NzbDrone.Core.Indexers
public abstract IList<ReleaseInfo> FetchRecent();
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public abstract IList<ReleaseInfo> Fetch(SeasonSearchCriteria searchCriteria);
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public abstract IList<ReleaseInfo> Fetch(SingleEpisodeSearchCriteria searchCriteria);
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public abstract IList<ReleaseInfo> Fetch(DailyEpisodeSearchCriteria searchCriteria);
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public abstract IList<ReleaseInfo> Fetch(AnimeEpisodeSearchCriteria searchCriteria);
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public abstract IList<ReleaseInfo> Fetch(SpecialEpisodeSearchCriteria searchCriteria);
public abstract IList<ReleaseInfo> Fetch(AlbumSearchCriteria searchCriteria);
public abstract IList<ReleaseInfo> Fetch(ArtistSearchCriteria searchCriteria);

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
@ -32,19 +32,6 @@ namespace NzbDrone.Core.Indexers.Newznab
}
}
private bool SupportsTvSearch
{
get
{
var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
return capabilities.SupportedTvSearchParameters != null &&
capabilities.SupportedTvSearchParameters.Contains("q") &&
capabilities.SupportedTvSearchParameters.Contains("season") &&
capabilities.SupportedTvSearchParameters.Contains("ep");
}
}
private bool SupportsAudioSearch
{
get
@ -58,57 +45,6 @@ namespace NzbDrone.Core.Indexers.Newznab
}
}
private bool SupportsTvdbSearch
{
get
{
var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
return capabilities.SupportedTvSearchParameters != null &&
capabilities.SupportedTvSearchParameters.Contains("tvdbid") &&
capabilities.SupportedTvSearchParameters.Contains("season") &&
capabilities.SupportedTvSearchParameters.Contains("ep");
}
}
private bool SupportsTvRageSearch
{
get
{
var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
return capabilities.SupportedTvSearchParameters != null &&
capabilities.SupportedTvSearchParameters.Contains("rid") &&
capabilities.SupportedTvSearchParameters.Contains("season") &&
capabilities.SupportedTvSearchParameters.Contains("ep");
}
}
private bool SupportsTvMazeSearch
{
get
{
var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
return capabilities.SupportedTvSearchParameters != null &&
capabilities.SupportedTvSearchParameters.Contains("tvmazeid") &&
capabilities.SupportedTvSearchParameters.Contains("season") &&
capabilities.SupportedTvSearchParameters.Contains("ep");
}
}
private bool SupportsAggregatedIdSearch
{
get
{
var capabilities = _capabilitiesProvider.GetCapabilities(Settings);
return capabilities.SupportsAggregateIdSearch;
}
}
public virtual IndexerPageableRequestChain GetRecentRequests()
{
var pageableRequests = new IndexerPageableRequestChain();
@ -123,78 +59,6 @@ namespace NzbDrone.Core.Indexers.Newznab
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
AddTvIdPageableRequests(pageableRequests, MaxPages, Settings.Categories, searchCriteria,
string.Format("&season={0}&ep={1}",
searchCriteria.SeasonNumber,
searchCriteria.EpisodeNumber));
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
AddTvIdPageableRequests(pageableRequests, MaxPages, Settings.Categories, searchCriteria,
string.Format("&season={0}",
searchCriteria.SeasonNumber));
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
AddTvIdPageableRequests(pageableRequests, MaxPages, Settings.Categories, searchCriteria,
string.Format("&season={0:yyyy}&ep={0:MM}/{0:dd}",
searchCriteria.AirDate));
return pageableRequests;
}
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;
}
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;
}
public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
@ -218,66 +82,6 @@ namespace NzbDrone.Core.Indexers.Newznab
return pageableRequests;
}
private void AddTvIdPageableRequests(IndexerPageableRequestChain chain, int maxPages, IEnumerable<int> categories, SearchCriteriaBase searchCriteria, string parameters)
{
var includeTvdbSearch = SupportsTvdbSearch && searchCriteria.Series.TvdbId > 0;
var includeTvRageSearch = SupportsTvRageSearch && searchCriteria.Series.TvRageId > 0;
var includeTvMazeSearch = SupportsTvMazeSearch && searchCriteria.Series.TvMazeId > 0;
if (SupportsAggregatedIdSearch && (includeTvdbSearch || includeTvRageSearch || includeTvMazeSearch))
{
var ids = "";
if (includeTvdbSearch)
{
ids += "&tvdbid=" + searchCriteria.Series.TvdbId;
}
if (includeTvRageSearch)
{
ids += "&rid=" + searchCriteria.Series.TvRageId;
}
if (includeTvMazeSearch)
{
ids += "&tvmazeid=" + searchCriteria.Series.TvMazeId;
}
chain.Add(GetPagedRequests(maxPages, categories, "tvsearch", ids + parameters));
}
else
{
if (includeTvdbSearch)
{
chain.Add(GetPagedRequests(maxPages, categories, "tvsearch",
string.Format("&tvdbid={0}{1}", searchCriteria.Series.TvdbId, parameters)));
}
else if (includeTvRageSearch)
{
chain.Add(GetPagedRequests(maxPages, categories, "tvsearch",
string.Format("&rid={0}{1}", searchCriteria.Series.TvRageId, parameters)));
}
else if (includeTvMazeSearch)
{
chain.Add(GetPagedRequests(maxPages, categories, "tvsearch",
string.Format("&tvmazeid={0}{1}", searchCriteria.Series.TvMazeId, parameters)));
}
}
if (SupportsTvSearch)
{
chain.AddTier();
foreach (var queryTitle in searchCriteria.QueryTitles)
{
chain.Add(GetPagedRequests(MaxPages, Settings.Categories, "tvsearch",
string.Format("&q={0}{1}",
NewsnabifyTitle(queryTitle),
parameters)));
}
}
}
private void AddAudioPageableRequests(IndexerPageableRequestChain chain, string parameters)
{

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
@ -26,54 +26,6 @@ namespace NzbDrone.Core.Indexers.Nyaa
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
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;
}
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(AlbumSearchCriteria searchCriteria)
{
throw new System.NotImplementedException();

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Text;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
@ -25,69 +25,6 @@ namespace NzbDrone.Core.Indexers.Omgwtfnzbs
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
foreach (var queryTitle in searchCriteria.QueryTitles)
{
pageableRequests.Add(GetPagedRequests(string.Format("{0}+S{1:00}E{2:00}",
queryTitle,
searchCriteria.SeasonNumber,
searchCriteria.EpisodeNumber)));
}
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
foreach (var queryTitle in searchCriteria.QueryTitles)
{
pageableRequests.Add(GetPagedRequests(string.Format("{0}+S{1:00}",
queryTitle,
searchCriteria.SeasonNumber)));
}
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
foreach (var queryTitle in searchCriteria.QueryTitles)
{
pageableRequests.Add(GetPagedRequests(string.Format("{0}+{1:yyyy MM dd}",
queryTitle,
searchCriteria.AirDate)));
}
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
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 IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
@ -25,58 +25,6 @@ namespace NzbDrone.Core.Indexers.Rarbg
return pageableRequests;
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests("search", searchCriteria.Series.TvdbId, "S{0:00}E{1:00}", searchCriteria.SeasonNumber, searchCriteria.EpisodeNumber));
return pageableRequests;
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests("search", searchCriteria.Series.TvdbId, "S{0:00}", searchCriteria.SeasonNumber));
return pageableRequests;
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();
pageableRequests.Add(GetPagedRequests("search", searchCriteria.Series.TvdbId, "\"{0:yyyy MM dd}\"", searchCriteria.AirDate));
return pageableRequests;
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
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("search", searchCriteria.Series.TvdbId, query));
}
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();

@ -1,4 +1,4 @@
using NzbDrone.Common.Http;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
namespace NzbDrone.Core.Indexers
@ -22,31 +22,6 @@ namespace NzbDrone.Core.Indexers
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
throw new System.NotImplementedException();

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
@ -18,31 +18,6 @@ namespace NzbDrone.Core.Indexers.TorrentRss
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
throw new System.NotImplementedException();

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Common.Http;
using NzbDrone.Core.IndexerSearch.Definitions;
@ -17,31 +17,6 @@ namespace NzbDrone.Core.Indexers.Torrentleech
return pageableRequests;
}
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
return new IndexerPageableRequestChain();
}
public virtual IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
throw new System.NotImplementedException();

@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Http;
using System.Text;
@ -26,36 +26,6 @@ namespace NzbDrone.Core.Indexers.Waffles
return pageableRequests;
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(SingleEpisodeSearchCriteria searchCriteria)
{
throw new NotImplementedException ();
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(SeasonSearchCriteria searchCriteria)
{
throw new NotImplementedException();
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(DailyEpisodeSearchCriteria searchCriteria)
{
throw new NotImplementedException();
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(AnimeEpisodeSearchCriteria searchCriteria)
{
throw new NotImplementedException();
}
[System.Obsolete("Sonarr TV Stuff -- Shouldn't be needed for Lidarr")]
public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearchCriteria searchCriteria)
{
throw new NotImplementedException();
}
public IndexerPageableRequestChain GetSearchRequests(AlbumSearchCriteria searchCriteria)
{
var pageableRequests = new IndexerPageableRequestChain();

@ -689,20 +689,9 @@
<Compile Include="Indexers\Torznab\TorznabRssParser.cs" />
<Compile Include="Indexers\Torznab\TorznabSettings.cs" />
<Compile Include="Indexers\XElementExtensions.cs" />
<Compile Include="IndexerSearch\Definitions\AnimeEpisodeSearchCriteria.cs" />
<Compile Include="IndexerSearch\Definitions\DailyEpisodeSearchCriteria.cs" />
<Compile Include="IndexerSearch\Definitions\SearchCriteriaBase.cs" />
<Compile Include="IndexerSearch\Definitions\SeasonSearchCriteria.cs" />
<Compile Include="IndexerSearch\Definitions\SingleEpisodeSearchCriteria.cs" />
<Compile Include="IndexerSearch\Definitions\SpecialEpisodeSearchCriteria.cs" />
<Compile Include="IndexerSearch\EpisodeSearchCommand.cs" />
<Compile Include="IndexerSearch\EpisodeSearchService.cs" />
<Compile Include="IndexerSearch\MissingEpisodeSearchCommand.cs" />
<Compile Include="IndexerSearch\NzbSearchService.cs" />
<Compile Include="IndexerSearch\SeasonSearchCommand.cs" />
<Compile Include="IndexerSearch\SeasonSearchService.cs" />
<Compile Include="IndexerSearch\SeriesSearchCommand.cs" />
<Compile Include="IndexerSearch\SeriesSearchService.cs" />
<Compile Include="Instrumentation\Commands\ClearLogCommand.cs" />
<Compile Include="Instrumentation\Commands\DeleteLogFilesCommand.cs" />
<Compile Include="Instrumentation\Commands\DeleteUpdateLogFilesCommand.cs" />

@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using NLog;
@ -44,7 +44,7 @@ namespace NzbDrone.Core.Tv
if (missing.Any())
{
_commandQueueManager.Push(new EpisodeSearchCommand(missing.Select(e => e.Id).ToList()));
//_commandQueueManager.Push(new EpisodeSearchCommand(missing.Select(e => e.Id).ToList()));
}
}

Loading…
Cancel
Save