From e23a87966924163da283a8a7287bfb54c865b67a Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 20 Mar 2020 17:34:18 -0700 Subject: [PATCH] Fixed: Cutoff unmet searches rejecting releases incorrectly --- .../src/Wanted/CutoffUnmet/CutoffUnmet.js | 10 ++- .../CutoffUnmet/CutoffUnmetConnector.js | 5 +- frontend/src/Wanted/Missing/Missing.js | 10 ++- .../src/Wanted/Missing/MissingConnector.js | 5 +- .../NzbSearchServiceFixture.cs | 26 +++---- .../SeriesSearchServiceFixture.cs | 8 +-- .../CutoffUnmetEpisodeSearchCommand.cs | 3 + .../Definitions/SeasonSearchCriteria.cs | 2 - .../IndexerSearch/EpisodeSearchService.cs | 67 +++++++++++-------- .../MissingEpisodeSearchCommand.cs | 3 + .../IndexerSearch/NzbSearchService.cs | 18 +++-- .../IndexerSearch/SeasonSearchService.cs | 2 +- .../IndexerSearch/SeriesSearchService.cs | 2 +- src/Sonarr.Api.V3/Indexers/ReleaseModule.cs | 2 +- 14 files changed, 101 insertions(+), 62 deletions(-) diff --git a/frontend/src/Wanted/CutoffUnmet/CutoffUnmet.js b/frontend/src/Wanted/CutoffUnmet/CutoffUnmet.js index e12d3a160..efdb3d886 100644 --- a/frontend/src/Wanted/CutoffUnmet/CutoffUnmet.js +++ b/frontend/src/Wanted/CutoffUnmet/CutoffUnmet.js @@ -100,7 +100,15 @@ class CutoffUnmet extends Component { } onSearchAllCutoffUnmetConfirmed = () => { - this.props.onSearchAllCutoffUnmetPress(); + const { + selectedFilterKey, + onSearchAllCutoffUnmetPress + } = this.props; + + // TODO: Custom filters will need to check whether there is a monitored + // filter once implemented. + + onSearchAllCutoffUnmetPress(selectedFilterKey === 'monitored'); this.setState({ isConfirmSearchAllCutoffUnmetModalOpen: false }); } diff --git a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js index 715cfec00..acb571c4f 100644 --- a/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js +++ b/frontend/src/Wanted/CutoffUnmet/CutoffUnmetConnector.js @@ -130,9 +130,10 @@ class CutoffUnmetConnector extends Component { }); } - onSearchAllCutoffUnmetPress = () => { + onSearchAllCutoffUnmetPress = (monitored) => { this.props.executeCommand({ - name: commandNames.CUTOFF_UNMET_EPISODE_SEARCH + name: commandNames.CUTOFF_UNMET_EPISODE_SEARCH, + monitored }); } diff --git a/frontend/src/Wanted/Missing/Missing.js b/frontend/src/Wanted/Missing/Missing.js index 22aaa2cbc..5dcfe8d7a 100644 --- a/frontend/src/Wanted/Missing/Missing.js +++ b/frontend/src/Wanted/Missing/Missing.js @@ -97,7 +97,15 @@ class Missing extends Component { } onSearchAllMissingConfirmed = () => { - this.props.onSearchAllMissingPress(); + const { + selectedFilterKey, + onSearchAllMissingPress + } = this.props; + + // TODO: Custom filters will need to check whether there is a monitored + // filter once implemented. + + onSearchAllMissingPress(selectedFilterKey === 'monitored'); this.setState({ isConfirmSearchAllMissingModalOpen: false }); } diff --git a/frontend/src/Wanted/Missing/MissingConnector.js b/frontend/src/Wanted/Missing/MissingConnector.js index a1632c6dd..439f730a1 100644 --- a/frontend/src/Wanted/Missing/MissingConnector.js +++ b/frontend/src/Wanted/Missing/MissingConnector.js @@ -121,9 +121,10 @@ class MissingConnector extends Component { }); } - onSearchAllMissingPress = () => { + onSearchAllMissingPress = (monitored) => { this.props.executeCommand({ - name: commandNames.MISSING_EPISODE_SEARCH + name: commandNames.MISSING_EPISODE_SEARCH, + monitored }); } diff --git a/src/NzbDrone.Core.Test/IndexerSearchTests/NzbSearchServiceFixture.cs b/src/NzbDrone.Core.Test/IndexerSearchTests/NzbSearchServiceFixture.cs index 28f9c5e1c..9bb8a1e96 100644 --- a/src/NzbDrone.Core.Test/IndexerSearchTests/NzbSearchServiceFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerSearchTests/NzbSearchServiceFixture.cs @@ -152,7 +152,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, 1, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, 1, false, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -167,7 +167,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, 2, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, 2, false, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -183,7 +183,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, 4, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, 4, false, false, true, false); var criteria1 = allCriteria.OfType().ToList(); var criteria2 = allCriteria.OfType().ToList(); @@ -203,7 +203,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, 7, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, 7, false, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -221,7 +221,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var seasonNumber = 1; var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, seasonNumber, true, true, false); + Subject.SeasonSearch(_xemSeries.Id, seasonNumber, true, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -239,7 +239,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var seasonNumber = 1; var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, seasonNumber, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, seasonNumber, false, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -257,7 +257,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var seasonNumber = 1; var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, seasonNumber, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, seasonNumber, false, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -274,7 +274,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var seasonNumber = 1; var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, seasonNumber, true, true, false); + Subject.SeasonSearch(_xemSeries.Id, seasonNumber, true, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -291,7 +291,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var seasonNumber = 1; var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, seasonNumber, true, true, false); + Subject.SeasonSearch(_xemSeries.Id, seasonNumber, true, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -310,7 +310,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, 1, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, 1, false, false, true, false); var criteria = allCriteria.OfType().ToList(); @@ -329,7 +329,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, 1, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, 1, false, false, true, false); var criteria1 = allCriteria.OfType().ToList(); var criteria2 = allCriteria.OfType().ToList(); @@ -352,7 +352,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, 1, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, 1, false, false, true, false); var criteria1 = allCriteria.OfType().ToList(); var criteria2 = allCriteria.OfType().ToList(); @@ -368,7 +368,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests var allCriteria = WatchForSearchCriteria(); - Subject.SeasonSearch(_xemSeries.Id, 7, false, true, false); + Subject.SeasonSearch(_xemSeries.Id, 7, false, false, true, false); Mocker.GetMock() .Verify(v => v.GetSceneNames(_xemSeries.Id, It.Is>(l => l.Contains(7)), It.Is>(l => l.Contains(7))), Times.Once()); diff --git a/src/NzbDrone.Core.Test/IndexerSearchTests/SeriesSearchServiceFixture.cs b/src/NzbDrone.Core.Test/IndexerSearchTests/SeriesSearchServiceFixture.cs index 8056f7a2e..591a5d546 100644 --- a/src/NzbDrone.Core.Test/IndexerSearchTests/SeriesSearchServiceFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerSearchTests/SeriesSearchServiceFixture.cs @@ -32,7 +32,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests .Returns(_series); Mocker.GetMock() - .Setup(s => s.SeasonSearch(_series.Id, It.IsAny(), false, true, false)) + .Setup(s => s.SeasonSearch(_series.Id, It.IsAny(), false, false, true, false)) .Returns(new List()); Mocker.GetMock() @@ -52,7 +52,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests Subject.Execute(new SeriesSearchCommand { SeriesId = _series.Id, Trigger = CommandTrigger.Manual }); Mocker.GetMock() - .Verify(v => v.SeasonSearch(_series.Id, It.IsAny(), false, true, false), Times.Exactly(_series.Seasons.Count(s => s.Monitored))); + .Verify(v => v.SeasonSearch(_series.Id, It.IsAny(), false, true, true, false), Times.Exactly(_series.Seasons.Count(s => s.Monitored))); } [Test] @@ -68,9 +68,9 @@ namespace NzbDrone.Core.Test.IndexerSearchTests }; Mocker.GetMock() - .Setup(s => s.SeasonSearch(_series.Id, It.IsAny(), false, true, false)) + .Setup(s => s.SeasonSearch(_series.Id, It.IsAny(), false, true, true, false)) .Returns(new List()) - .Callback((seriesId, seasonNumber, missingOnly, userInvokedSearch, interactiveSearch) => seasonOrder.Add(seasonNumber)); + .Callback((seriesId, seasonNumber, missingOnly, monitoredOnly, userInvokedSearch, interactiveSearch) => seasonOrder.Add(seasonNumber)); Subject.Execute(new SeriesSearchCommand { SeriesId = _series.Id, Trigger = CommandTrigger.Manual }); diff --git a/src/NzbDrone.Core/IndexerSearch/CutoffUnmetEpisodeSearchCommand.cs b/src/NzbDrone.Core/IndexerSearch/CutoffUnmetEpisodeSearchCommand.cs index 2719bfaec..bc6c85cb8 100644 --- a/src/NzbDrone.Core/IndexerSearch/CutoffUnmetEpisodeSearchCommand.cs +++ b/src/NzbDrone.Core/IndexerSearch/CutoffUnmetEpisodeSearchCommand.cs @@ -5,6 +5,7 @@ namespace NzbDrone.Core.IndexerSearch public class CutoffUnmetEpisodeSearchCommand : Command { public int? SeriesId { get; set; } + public bool Monitored { get; set; } public override bool SendUpdatesToClient { @@ -16,11 +17,13 @@ namespace NzbDrone.Core.IndexerSearch public CutoffUnmetEpisodeSearchCommand() { + Monitored = true; } public CutoffUnmetEpisodeSearchCommand(int seriesId) { SeriesId = seriesId; + Monitored = true; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/IndexerSearch/Definitions/SeasonSearchCriteria.cs b/src/NzbDrone.Core/IndexerSearch/Definitions/SeasonSearchCriteria.cs index 122df795d..cec5aad37 100644 --- a/src/NzbDrone.Core/IndexerSearch/Definitions/SeasonSearchCriteria.cs +++ b/src/NzbDrone.Core/IndexerSearch/Definitions/SeasonSearchCriteria.cs @@ -4,8 +4,6 @@ namespace NzbDrone.Core.IndexerSearch.Definitions { public int SeasonNumber { get; set; } - public override bool MonitoredEpisodesOnly => true; - public override string ToString() { return string.Format("[{0} : S{1:00}]", Series.Title, SeasonNumber); diff --git a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs index 1102a7efd..758d878f4 100644 --- a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs @@ -40,9 +40,9 @@ namespace NzbDrone.Core.IndexerSearch _logger = logger; } - private void SearchForMissingEpisodes(List episodes, bool userInvokedSearch) + private void SearchForEpisodes(List episodes, bool monitoredOnly, bool userInvokedSearch) { - _logger.ProgressInfo("Performing missing search for {0} episodes", episodes.Count); + _logger.ProgressInfo("Performing search for {0} episodes", episodes.Count); var downloadedCount = 0; foreach (var series in episodes.GroupBy(e => e.SeriesId)) @@ -55,11 +55,11 @@ namespace NzbDrone.Core.IndexerSearch { try { - decisions = _nzbSearchService.SeasonSearch(series.Key, season.Key, true, userInvokedSearch, false); + decisions = _nzbSearchService.SeasonSearch(series.Key, season.Key, season.ToList(), monitoredOnly, userInvokedSearch, false); } catch (Exception ex) { - _logger.Error(ex, "Unable to search for missing episodes in season {0} of [{1}]", season.Key, series.Key); + _logger.Error(ex, "Unable to search for episodes in season {0} of [{1}]", season.Key, series.Key); continue; } } @@ -72,7 +72,7 @@ namespace NzbDrone.Core.IndexerSearch } catch (Exception ex) { - _logger.Error(ex, "Unable to search for missing episode: [{0}]", season.First()); + _logger.Error(ex, "Unable to search for episode: [{0}]", season.First()); continue; } } @@ -83,7 +83,12 @@ namespace NzbDrone.Core.IndexerSearch } } - _logger.ProgressInfo("Completed missing search for {0} episodes. {1} reports downloaded.", episodes.Count, downloadedCount); + _logger.ProgressInfo("Completed search for {0} episodes. {1} reports downloaded.", episodes.Count, downloadedCount); + } + + private bool IsMonitored(bool episodeMonitored, bool seriesMonitored) + { + return episodeMonitored && seriesMonitored; } public void Execute(EpisodeSearchCommand message) @@ -99,12 +104,13 @@ namespace NzbDrone.Core.IndexerSearch public void Execute(MissingEpisodeSearchCommand message) { + var monitored = message.Monitored; List episodes; if (message.SeriesId.HasValue) { episodes = _episodeService.GetEpisodeBySeries(message.SeriesId.Value) - .Where(e => e.Monitored && + .Where(e => e.Monitored == monitored && !e.HasFile && e.AirDateUtc.HasValue && e.AirDateUtc.Value.Before(DateTime.UtcNow)) @@ -121,7 +127,14 @@ namespace NzbDrone.Core.IndexerSearch SortKey = "Id" }; - pagingSpec.FilterExpressions.Add(v => v.Monitored == true &&v.Series.Monitored == true); + if (monitored) + { + pagingSpec.FilterExpressions.Add(v => v.Monitored == true && v.Series.Monitored == true); + } + else + { + pagingSpec.FilterExpressions.Add(v => v.Monitored == false || v.Series.Monitored == false); + } episodes = _episodeService.EpisodesWithoutFiles(pagingSpec).Records.ToList(); } @@ -129,27 +142,12 @@ namespace NzbDrone.Core.IndexerSearch var queue = _queueService.GetQueue().Where(q => q.Episode != null).Select(q => q.Episode.Id); var missing = episodes.Where(e => !queue.Contains(e.Id)).ToList(); - SearchForMissingEpisodes(missing, message.Trigger == CommandTrigger.Manual); + SearchForEpisodes(missing, monitored, message.Trigger == CommandTrigger.Manual); } public void Execute(CutoffUnmetEpisodeSearchCommand message) { - Expression> filterExpression; - - if (message.SeriesId.HasValue) - { - filterExpression = v => - v.SeriesId == message.SeriesId.Value && - v.Monitored == true && - v.Series.Monitored == true; - } - - else - { - filterExpression = v => - v.Monitored == true && - v.Series.Monitored == true; - } + var monitored = message.Monitored; var pagingSpec = new PagingSpec { @@ -159,14 +157,25 @@ namespace NzbDrone.Core.IndexerSearch SortKey = "Id" }; - pagingSpec.FilterExpressions.Add(filterExpression); + if (message.SeriesId.HasValue) + { + pagingSpec.FilterExpressions.Add(v => v.SeriesId == message.SeriesId.Value); + } + + if (monitored) + { + pagingSpec.FilterExpressions.Add(v => v.Monitored == true && v.Series.Monitored == true); + } + else + { + pagingSpec.FilterExpressions.Add(v => v.Monitored == false || v.Series.Monitored == false); + } var episodes = _episodeCutoffService.EpisodesWhereCutoffUnmet(pagingSpec).Records.ToList(); - var queue = _queueService.GetQueue().Where(q => q.Episode != null).Select(q => q.Episode.Id); - var missing = episodes.Where(e => !queue.Contains(e.Id)).ToList(); + var cutoffUnmet = episodes.Where(e => !queue.Contains(e.Id)).ToList(); - SearchForMissingEpisodes(missing, message.Trigger == CommandTrigger.Manual); + SearchForEpisodes(cutoffUnmet, monitored, message.Trigger == CommandTrigger.Manual); } } } diff --git a/src/NzbDrone.Core/IndexerSearch/MissingEpisodeSearchCommand.cs b/src/NzbDrone.Core/IndexerSearch/MissingEpisodeSearchCommand.cs index 3e2097be3..350e8825e 100644 --- a/src/NzbDrone.Core/IndexerSearch/MissingEpisodeSearchCommand.cs +++ b/src/NzbDrone.Core/IndexerSearch/MissingEpisodeSearchCommand.cs @@ -5,16 +5,19 @@ namespace NzbDrone.Core.IndexerSearch public class MissingEpisodeSearchCommand : Command { public int? SeriesId { get; set; } + public bool Monitored { get; set; } public override bool SendUpdatesToClient => true; public MissingEpisodeSearchCommand() { + Monitored = true; } public MissingEpisodeSearchCommand(int seriesId) { SeriesId = seriesId; + Monitored = true; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index 61bdc322a..7937c7b8b 100644 --- a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -21,7 +21,8 @@ namespace NzbDrone.Core.IndexerSearch { List EpisodeSearch(int episodeId, bool userInvokedSearch, bool interactiveSearch); List EpisodeSearch(Episode episode, bool userInvokedSearch, bool interactiveSearch); - List SeasonSearch(int seriesId, int seasonNumber, bool missingOnly, bool userInvokedSearch, bool interactiveSearch); + List SeasonSearch(int seriesId, int seasonNumber, bool missingOnly, bool monitoredOnly, bool userInvokedSearch, bool interactiveSearch); + List SeasonSearch(int seriesId, int seasonNumber, List episodes, bool monitoredOnly, bool userInvokedSearch, bool interactiveSearch); } public class NzbSearchService : ISearchForNzb @@ -83,16 +84,21 @@ namespace NzbDrone.Core.IndexerSearch return SearchSingle(series, episode, userInvokedSearch, interactiveSearch); } - public List SeasonSearch(int seriesId, int seasonNumber, bool missingOnly, bool userInvokedSearch, bool interactiveSearch) + public List SeasonSearch(int seriesId, int seasonNumber, bool missingOnly, bool monitoredOnly, bool userInvokedSearch, bool interactiveSearch) { - var series = _seriesService.GetSeries(seriesId); var episodes = _episodeService.GetEpisodesBySeason(seriesId, seasonNumber); if (missingOnly) { - episodes = episodes.Where(e => e.Monitored && !e.HasFile).ToList(); + episodes = episodes.Where(e => !e.HasFile).ToList(); } + return SeasonSearch(seriesId, seasonNumber, episodes, monitoredOnly, userInvokedSearch, interactiveSearch); + } + public List SeasonSearch(int seriesId, int seasonNumber, List episodes, bool monitoredOnly, bool userInvokedSearch, bool interactiveSearch) + { + var series = _seriesService.GetSeries(seriesId); + if (series.SeriesType == SeriesTypes.Anime) { return SearchAnimeSeason(series, episodes, userInvokedSearch, interactiveSearch); @@ -130,7 +136,7 @@ namespace NzbDrone.Core.IndexerSearch var searchSpec = Get(series, sceneSeasonEpisodes.ToList(), userInvokedSearch, interactiveSearch); searchSpec.SeasonNumber = sceneSeasonEpisodes.Key; - searchSpec.MonitoredEpisodesOnly = true; + searchSpec.MonitoredEpisodesOnly = monitoredOnly; if (episode.SceneSeasonNumber.HasValue && episode.SceneEpisodeNumber.HasValue) { @@ -148,6 +154,7 @@ namespace NzbDrone.Core.IndexerSearch { var searchSpec = Get(series, sceneSeasonEpisodes.ToList(), userInvokedSearch, interactiveSearch); searchSpec.SeasonNumber = sceneSeasonEpisodes.Key; + searchSpec.MonitoredEpisodesOnly = monitoredOnly; var decisions = Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec); downloadDecisions.AddRange(decisions); @@ -158,6 +165,7 @@ namespace NzbDrone.Core.IndexerSearch { var searchSpec = Get(series, episodes, userInvokedSearch, interactiveSearch); searchSpec.SeasonNumber = seasonNumber; + searchSpec.MonitoredEpisodesOnly = monitoredOnly; var decisions = Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec); downloadDecisions.AddRange(decisions); diff --git a/src/NzbDrone.Core/IndexerSearch/SeasonSearchService.cs b/src/NzbDrone.Core/IndexerSearch/SeasonSearchService.cs index c35f38ab0..0453e329a 100644 --- a/src/NzbDrone.Core/IndexerSearch/SeasonSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/SeasonSearchService.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.IndexerSearch public void Execute(SeasonSearchCommand message) { - var decisions = _nzbSearchService.SeasonSearch(message.SeriesId, message.SeasonNumber, false, message.Trigger == CommandTrigger.Manual, false); + var decisions = _nzbSearchService.SeasonSearch(message.SeriesId, message.SeasonNumber, false, true, message.Trigger == CommandTrigger.Manual, false); var processed = _processDownloadDecisions.ProcessDecisions(decisions); _logger.ProgressInfo("Season search completed. {0} reports downloaded.", processed.Grabbed.Count); diff --git a/src/NzbDrone.Core/IndexerSearch/SeriesSearchService.cs b/src/NzbDrone.Core/IndexerSearch/SeriesSearchService.cs index 3e25af42e..e92393db4 100644 --- a/src/NzbDrone.Core/IndexerSearch/SeriesSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/SeriesSearchService.cs @@ -39,7 +39,7 @@ namespace NzbDrone.Core.IndexerSearch continue; } - var decisions = _nzbSearchService.SeasonSearch(message.SeriesId, season.SeasonNumber, false, message.Trigger == CommandTrigger.Manual, false); + var decisions = _nzbSearchService.SeasonSearch(message.SeriesId, season.SeasonNumber, false, true, message.Trigger == CommandTrigger.Manual, false); downloadedCount += _processDownloadDecisions.ProcessDecisions(decisions).Grabbed.Count; } diff --git a/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs b/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs index 8a7e2ca19..aa3c351c4 100644 --- a/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs +++ b/src/Sonarr.Api.V3/Indexers/ReleaseModule.cs @@ -171,7 +171,7 @@ namespace Sonarr.Api.V3.Indexers { try { - var decisions = _nzbSearchService.SeasonSearch(seriesId, seasonNumber, false, true, true); + var decisions = _nzbSearchService.SeasonSearch(seriesId, seasonNumber, false, false, true, true); var prioritizedDecisions = _prioritizeDownloadDecision.PrioritizeDecisions(decisions); return MapDecisions(prioritizedDecisions);