mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
RssItemProcessingProvider will now handle full series NZBs.
This commit is contained in:
parent
fd06987331
commit
1076b3ab58
8 changed files with 214 additions and 43 deletions
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Repository;
|
||||
using SubSonic.Repository;
|
||||
using System.Linq;
|
||||
|
@ -10,11 +11,14 @@ namespace NzbDrone.Core.Providers
|
|||
class SeasonProvider : ISeasonProvider
|
||||
{
|
||||
private readonly IRepository _sonicRepo;
|
||||
private readonly ISeriesProvider _seriesProvider;
|
||||
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public SeasonProvider(IRepository dataRepository)
|
||||
public SeasonProvider(IRepository dataRepository, ISeriesProvider seriesProvider)
|
||||
{
|
||||
_sonicRepo = dataRepository;
|
||||
_seriesProvider = seriesProvider;
|
||||
}
|
||||
|
||||
public Season GetSeason(int seasonId)
|
||||
|
@ -22,6 +26,11 @@ namespace NzbDrone.Core.Providers
|
|||
return _sonicRepo.Single<Season>(seasonId);
|
||||
}
|
||||
|
||||
public Season GetSeason(int seriesId, int seasonNumber)
|
||||
{
|
||||
return _sonicRepo.Single<Season>(s => s.SeriesId == seriesId && s.SeasonNumber == seasonNumber);
|
||||
}
|
||||
|
||||
public List<Season> GetSeasons(int seriesId)
|
||||
{
|
||||
return _sonicRepo.All<Season>().Where(s => s.SeriesId == seriesId).ToList();
|
||||
|
@ -70,7 +79,7 @@ namespace NzbDrone.Core.Providers
|
|||
if (season == null)
|
||||
return true;
|
||||
|
||||
return season.Monitored;
|
||||
return !season.Monitored;
|
||||
}
|
||||
|
||||
public void DeleteSeason(int seasonId)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue