mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
cleaned up parsing logic and structure.
This commit is contained in:
parent
cd2761d07d
commit
6e88f55a54
120 changed files with 2149 additions and 3064 deletions
|
@ -1,6 +1,8 @@
|
|||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Core.DecisionEngine.Specifications
|
||||
|
@ -26,29 +28,16 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
}
|
||||
}
|
||||
|
||||
public virtual bool IsSatisfiedBy(IndexerParseResult subject)
|
||||
public virtual bool IsSatisfiedBy(RemoteEpisode subject)
|
||||
{
|
||||
var series = _seriesRepository.GetByTitle(subject.CleanTitle);
|
||||
|
||||
if (series == null)
|
||||
if (!subject.Series.Monitored)
|
||||
{
|
||||
_logger.Trace("{0} is not mapped to any series in DB. skipping", subject.CleanTitle);
|
||||
_logger.Debug("{0} is present in the DB but not tracked. skipping.", subject.Series.Title);
|
||||
return false;
|
||||
}
|
||||
|
||||
subject.Series = series;
|
||||
|
||||
if (!series.Monitored)
|
||||
{
|
||||
_logger.Debug("{0} is present in the DB but not tracked. skipping.", subject.CleanTitle);
|
||||
return false;
|
||||
}
|
||||
|
||||
var episodes = _episodeService.GetEpisodesByParseResult(subject);
|
||||
subject.Episodes = episodes;
|
||||
|
||||
//return monitored if any of the episodes are monitored
|
||||
if (episodes.Any(episode => !episode.Ignored))
|
||||
if (subject.Episodes.Any(episode => !episode.Ignored))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue