1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Fixed: SeasonPass didn't update Series monitored flag if only those were changed.

This commit is contained in:
Taloth Saldono 2015-10-13 22:46:02 +02:00
parent 97cdcb8b19
commit f7859c8eb5
2 changed files with 65 additions and 49 deletions

View File

@ -66,6 +66,18 @@ private void GivenSpecials()
_series.Seasons = new List<Season>{new Season { Monitored = false, SeasonNumber = 0 }}; _series.Seasons = new List<Season>{new Season { Monitored = false, SeasonNumber = 0 }};
} }
[Test]
public void should_be_able_to_monitor_series_without_changing_episodes()
{
Subject.SetEpisodeMonitoredStatus(_series, null);
Mocker.GetMock<ISeriesService>()
.Verify(v => v.UpdateSeries(It.IsAny<Series>()), Times.Once());
Mocker.GetMock<IEpisodeService>()
.Verify(v => v.UpdateEpisodes(It.IsAny<List<Episode>>()), Times.Never());
}
[Test] [Test]
public void should_be_able_to_monitor_all_episodes() public void should_be_able_to_monitor_all_episodes()
{ {

View File

@ -25,6 +25,8 @@ public EpisodeMonitoredService(ISeriesService seriesService, IEpisodeService epi
} }
public void SetEpisodeMonitoredStatus(Series series, MonitoringOptions monitoringOptions) public void SetEpisodeMonitoredStatus(Series series, MonitoringOptions monitoringOptions)
{
if (monitoringOptions != null)
{ {
_logger.Debug("[{0}] Setting episode monitored status.", series.Title); _logger.Debug("[{0}] Setting episode monitored status.", series.Title);
@ -90,10 +92,12 @@ public void SetEpisodeMonitoredStatus(Series series, MonitoringOptions monitorin
} }
} }
_seriesService.UpdateSeries(series);
_episodeService.UpdateEpisodes(episodes); _episodeService.UpdateEpisodes(episodes);
} }
_seriesService.UpdateSeries(series);
}
private void ToggleEpisodesMonitoredState(IEnumerable<Episode> episodes, bool monitored) private void ToggleEpisodesMonitoredState(IEnumerable<Episode> episodes, bool monitored)
{ {
foreach (var episode in episodes) foreach (var episode in episodes)