mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-26 01:27:00 +00:00
Update episodes monitored state only when season changes
This commit is contained in:
parent
a81ca798a7
commit
6850d77dd2
4 changed files with 14 additions and 1 deletions
|
@ -189,6 +189,7 @@
|
|||
<Compile Include="MediaFiles\DownloadedEpisodesImportServiceFixture.cs" />
|
||||
<Compile Include="SeriesStatsTests\SeriesStatisticsFixture.cs" />
|
||||
<Compile Include="TvTests\SeriesRepositoryTests\QualityProfileRepositoryFixture.cs" />
|
||||
<Compile Include="TvTests\SeriesServiceTests\UpdateSeriesFixture.cs" />
|
||||
<Compile Include="UpdateTests\UpdateServiceFixture.cs" />
|
||||
<Compile Include="ProviderTests\XemCommunicationProviderTests\GetSceneTvdbMappingsFixture.cs" />
|
||||
<Compile Include="ProviderTests\XemCommunicationProviderTests\GetXemSeriesIdsFixture.cs" />
|
||||
|
@ -211,7 +212,7 @@
|
|||
<Compile Include="ParserTests\ParserFixture.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Qualities\QualityProfileServiceFixture.cs" />
|
||||
<Compile Include="TvTests\SeriesServiceFixture.cs" />
|
||||
<Compile Include="TvTests\SeriesServiceTests\AddSeriesFixture.cs" />
|
||||
<Compile Include="UpdateTests\UpdatePackageProviderFixture.cs" />
|
||||
<Compile Include="XbmcVersionTests.cs" />
|
||||
</ItemGroup>
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -119,6 +119,18 @@ public List<Series> GetAllSeries()
|
|||
|
||||
public Series UpdateSeries(Series series)
|
||||
{
|
||||
var storedSeries = GetSeries(series.Id);
|
||||
|
||||
foreach (var season in series.Seasons)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
return _seriesRepository.Update(series);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue