Fixed: Monitored status being reset after refresh when series is edited manually
This commit is contained in:
parent
488967c6ef
commit
98b1a7681b
|
@ -169,16 +169,22 @@ namespace NzbDrone.Core.Tv
|
||||||
{
|
{
|
||||||
var storedSeries = GetSeries(series.Id);
|
var storedSeries = GetSeries(series.Id);
|
||||||
|
|
||||||
foreach (var season in series.Seasons)
|
if (updateEpisodesToMatchSeason)
|
||||||
{
|
{
|
||||||
var storedSeason = storedSeries.Seasons.SingleOrDefault(s => s.SeasonNumber == season.SeasonNumber);
|
foreach (var season in series.Seasons)
|
||||||
|
|
||||||
if (storedSeason != null && season.Monitored != storedSeason.Monitored && updateEpisodesToMatchSeason)
|
|
||||||
{
|
{
|
||||||
_episodeService.SetEpisodeMonitoredBySeason(series.Id, season.SeasonNumber, season.Monitored);
|
var storedSeason = storedSeries.Seasons.SingleOrDefault(s => s.SeasonNumber == season.SeasonNumber);
|
||||||
|
|
||||||
|
if (storedSeason != null && season.Monitored != storedSeason.Monitored)
|
||||||
|
{
|
||||||
|
_episodeService.SetEpisodeMonitoredBySeason(series.Id, season.SeasonNumber, season.Monitored);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Never update AddOptions when updating a series, keep it the same as the existing stored series.
|
||||||
|
series.AddOptions = storedSeries.AddOptions;
|
||||||
|
|
||||||
var updatedSeries = _seriesRepository.Update(series);
|
var updatedSeries = _seriesRepository.Update(series);
|
||||||
_eventAggregator.PublishEvent(new SeriesEditedEvent(updatedSeries, storedSeries));
|
_eventAggregator.PublishEvent(new SeriesEditedEvent(updatedSeries, storedSeries));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue