Fixed: Season packs will no longer be grabbed if it contains an unmonitored episode.
This commit is contained in:
parent
74ad841be4
commit
d1ce1bf218
|
@ -91,17 +91,17 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void only_first_episode_not_monitored_should_return_monitored()
|
public void only_first_episode_not_monitored_should_return_false()
|
||||||
{
|
{
|
||||||
WithFirstEpisodeUnmonitored();
|
WithFirstEpisodeUnmonitored();
|
||||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
|
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void only_second_episode_not_monitored_should_return_monitored()
|
public void only_second_episode_not_monitored_should_return_false()
|
||||||
{
|
{
|
||||||
WithSecondEpisodeUnmonitored();
|
WithSecondEpisodeUnmonitored();
|
||||||
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
|
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -33,13 +33,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.RssSync
|
||||||
return Decision.Reject("Series is not monitored");
|
return Decision.Reject("Series is not monitored");
|
||||||
}
|
}
|
||||||
|
|
||||||
//return monitored if any of the episodes are monitored
|
var monitoredCount = subject.Episodes.Count(episode => episode.Monitored);
|
||||||
if (subject.Episodes.Any(episode => episode.Monitored))
|
if (monitoredCount == subject.Episodes.Count)
|
||||||
{
|
{
|
||||||
return Decision.Accept();
|
return Decision.Accept();
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Debug("No episodes are monitored. skipping.");
|
_logger.Debug("Only {0}/{1} episodes are monitored. skipping.", monitoredCount, subject.Episodes);
|
||||||
return Decision.Reject("Episode is not monitored");
|
return Decision.Reject("Episode is not monitored");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue