mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 02:22:31 +01:00
Fixed: Scene numbered season searches when some episode weren't monitored
This commit is contained in:
parent
a1a91878ad
commit
210524b51a
@ -123,5 +123,19 @@ public void should_return_false_if_episode_is_not_monitored_for_season_search()
|
||||
WithFirstEpisodeUnmonitored();
|
||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, new SeasonSearchCriteria()).Accepted.Should().BeFalse();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_true_if_episode_is_not_monitored_and_monitoredEpisodesOnly_flag_is_false()
|
||||
{
|
||||
WithFirstEpisodeUnmonitored();
|
||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, new SingleEpisodeSearchCriteria { MonitoredEpisodesOnly = false }).Accepted.Should().BeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void should_return_false_if_episode_is_not_monitored_and_monitoredEpisodesOnly_flag_is_true()
|
||||
{
|
||||
WithFirstEpisodeUnmonitored();
|
||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, new SingleEpisodeSearchCriteria{ MonitoredEpisodesOnly = true}).Accepted.Should().BeFalse();
|
||||
}
|
||||
}
|
||||
}
|
@ -20,7 +20,7 @@ public virtual Decision IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase
|
||||
{
|
||||
if (searchCriteria != null)
|
||||
{
|
||||
if ((searchCriteria as SeasonSearchCriteria) == null)
|
||||
if (!searchCriteria.MonitoredEpisodesOnly)
|
||||
{
|
||||
_logger.Debug("Skipping monitored check during search");
|
||||
return Decision.Accept();
|
||||
|
@ -17,6 +17,7 @@ public abstract class SearchCriteriaBase
|
||||
public Series Series { get; set; }
|
||||
public List<String> SceneTitles { get; set; }
|
||||
public List<Episode> Episodes { get; set; }
|
||||
public virtual bool MonitoredEpisodesOnly { get; set; }
|
||||
|
||||
public List<String> QueryTitles
|
||||
{
|
||||
|
@ -4,6 +4,14 @@ public class SeasonSearchCriteria : SearchCriteriaBase
|
||||
{
|
||||
public int SeasonNumber { get; set; }
|
||||
|
||||
public override bool MonitoredEpisodesOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("[{0} : S{1:00}]", Series.Title, SeasonNumber);
|
||||
|
@ -115,11 +115,18 @@ public List<DownloadDecision> SeasonSearch(int seriesId, int seasonNumber)
|
||||
{
|
||||
var episode = sceneSeasonEpisodes.First();
|
||||
var searchSpec = Get<SingleEpisodeSearchCriteria>(series, sceneSeasonEpisodes.ToList());
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user