1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-22 07:43:01 +00:00

Fixed: Don't monitor last season if series is ended

This commit is contained in:
Bogdan 2024-01-03 22:38:24 +02:00 committed by GitHub
parent 0673374e97
commit b6ffe935e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 2 deletions

View file

@ -313,6 +313,22 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeMonitoredServiceTests
.Verify(v => v.UpdateEpisodes(It.Is<List<Episode>>(l => l.All(e => !e.Monitored))));
}
[Test]
public void should_not_monitor_last_season_for_future_episodes_if_all_episodes_already_aired()
{
_episodes.ForEach(e => e.AirDateUtc = DateTime.UtcNow.AddDays(-7));
var monitoringOptions = new MonitoringOptions
{
Monitor = MonitorTypes.Future
};
Subject.SetEpisodeMonitoredStatus(_series, monitoringOptions);
VerifySeasonNotMonitored(n => n.SeasonNumber > 0);
VerifyNotMonitored(n => n.SeasonNumber > 0);
}
[Test]
public void should_monitor_any_recent_and_future_episodes_if_all_episodes_aired_within_90_days()
{

View file

@ -135,11 +135,12 @@ namespace NzbDrone.Core.Tv
// Monitor the last season when:
// - Not specials
// - The latest season
// - Set to monitor all or future episodes
// - Set to monitor all episodes
// - Set to monitor future episodes and series is continuing or not yet aired
if (seasonNumber > 0 &&
seasonNumber == lastSeason &&
(monitoringOptions.Monitor == MonitorTypes.All ||
monitoringOptions.Monitor == MonitorTypes.Future))
(monitoringOptions.Monitor == MonitorTypes.Future && series.Status is SeriesStatusType.Continuing or SeriesStatusType.Upcoming)))
{
season.Monitored = true;
}