Fixed: Don't monitor new seasons if series is not monitored

Fixes #3547
This commit is contained in:
Mark McDowall 2020-02-01 13:03:11 -08:00
parent db42256dc3
commit 010c65af9c
2 changed files with 22 additions and 3 deletions

View File

@ -54,8 +54,9 @@ namespace NzbDrone.Core.Test.TvTests
}
[Test]
public void should_monitor_new_seasons_automatically()
public void should_monitor_new_seasons_automatically_if_series_is_monitored()
{
_series.Monitored = true;
var newSeriesInfo = _series.JsonClone();
newSeriesInfo.Seasons.Add(Builder<Season>.CreateNew()
.With(s => s.SeasonNumber = 2)
@ -69,6 +70,23 @@ namespace NzbDrone.Core.Test.TvTests
.Verify(v => v.UpdateSeries(It.Is<Series>(s => s.Seasons.Count == 2 && s.Seasons.Single(season => season.SeasonNumber == 2).Monitored == true), It.IsAny<bool>()));
}
[Test]
public void should_not_monitor_new_seasons_automatically_if_series_is_not_monitored()
{
_series.Monitored = false;
var newSeriesInfo = _series.JsonClone();
newSeriesInfo.Seasons.Add(Builder<Season>.CreateNew()
.With(s => s.SeasonNumber = 2)
.Build());
GivenNewSeriesInfo(newSeriesInfo);
Subject.Execute(new RefreshSeriesCommand(_series.Id));
Mocker.GetMock<ISeriesService>()
.Verify(v => v.UpdateSeries(It.Is<Series>(s => s.Seasons.Count == 2 && s.Seasons.Single(season => season.SeasonNumber == 2).Monitored == false), It.IsAny<bool>()));
}
[Test]
public void should_not_monitor_new_special_season_automatically()
{

View File

@ -130,12 +130,13 @@ namespace NzbDrone.Core.Tv
{
if (season.SeasonNumber == 0)
{
_logger.Debug("Ignoring season 0 for series [{0}] {1} by default", series.TvdbId, series.Title);
season.Monitored = false;
continue;
}
_logger.Debug("New season ({0}) for series: [{1}] {2}, setting monitored to true", season.SeasonNumber, series.TvdbId, series.Title);
season.Monitored = true;
_logger.Debug("New season ({0}) for series: [{1}] {2}, setting monitored to {3}", season.SeasonNumber, series.TvdbId, series.Title, series.Monitored.ToString().ToLowerInvariant());
season.Monitored = series.Monitored;
}
else