mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Seasons are now subdocuments of series
This commit is contained in:
parent
0861e5f8c1
commit
33986a9185
40 changed files with 256 additions and 633 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
|
@ -64,6 +65,8 @@ namespace NzbDrone.Core.Tv
|
|||
_logger.WarnException("Couldn't update series path for " + series.Path, e);
|
||||
}
|
||||
|
||||
series.Seasons = UpdateSeasons(series, seriesInfo);
|
||||
|
||||
_seriesService.UpdateSeries(series);
|
||||
_refreshEpisodeService.RefreshEpisodeInfo(series, tuple.Item2);
|
||||
|
||||
|
@ -71,6 +74,21 @@ namespace NzbDrone.Core.Tv
|
|||
_messageAggregator.PublishEvent(new SeriesUpdatedEvent(series));
|
||||
}
|
||||
|
||||
private List<Season> UpdateSeasons(Series series, Series seriesInfo)
|
||||
{
|
||||
foreach (var season in seriesInfo.Seasons)
|
||||
{
|
||||
var existingSeason = series.Seasons.SingleOrDefault(s => s.SeasonNumber == season.SeasonNumber);
|
||||
|
||||
if (existingSeason != null)
|
||||
{
|
||||
season.Monitored = existingSeason.Monitored;
|
||||
}
|
||||
}
|
||||
|
||||
return seriesInfo.Seasons;
|
||||
}
|
||||
|
||||
public void Execute(RefreshSeriesCommand message)
|
||||
{
|
||||
if (message.SeriesId.HasValue)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue