mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-04-24 22:37:06 -04:00
Fixed: Don't monitor new seasons if series is not monitored
Fixes #3547
This commit is contained in:
parent
db42256dc3
commit
010c65af9c
2 changed files with 22 additions and 3 deletions
|
@ -54,8 +54,9 @@ namespace NzbDrone.Core.Test.TvTests
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[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();
|
var newSeriesInfo = _series.JsonClone();
|
||||||
newSeriesInfo.Seasons.Add(Builder<Season>.CreateNew()
|
newSeriesInfo.Seasons.Add(Builder<Season>.CreateNew()
|
||||||
.With(s => s.SeasonNumber = 2)
|
.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>()));
|
.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]
|
[Test]
|
||||||
public void should_not_monitor_new_special_season_automatically()
|
public void should_not_monitor_new_special_season_automatically()
|
||||||
{
|
{
|
||||||
|
|
|
@ -130,12 +130,13 @@ namespace NzbDrone.Core.Tv
|
||||||
{
|
{
|
||||||
if (season.SeasonNumber == 0)
|
if (season.SeasonNumber == 0)
|
||||||
{
|
{
|
||||||
|
_logger.Debug("Ignoring season 0 for series [{0}] {1} by default", series.TvdbId, series.Title);
|
||||||
season.Monitored = false;
|
season.Monitored = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Debug("New season ({0}) for series: [{1}] {2}, setting monitored to true", season.SeasonNumber, series.TvdbId, series.Title);
|
_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 = true;
|
season.Monitored = series.Monitored;
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue