mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
release endpoint now returns fully parsed rss info with decisions.
This commit is contained in:
parent
7e473ca78d
commit
ca8eba9cf1
43 changed files with 458 additions and 336 deletions
|
@ -30,13 +30,13 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
{
|
||||
_logger.Trace("Beginning size check for: {0}", subject);
|
||||
|
||||
if (subject.Quality.Quality == Quality.RAWHD)
|
||||
if (subject.ParsedEpisodeInfo.Quality.Quality == Quality.RAWHD)
|
||||
{
|
||||
_logger.Trace("Raw-HD release found, skipping size check.");
|
||||
return true;
|
||||
}
|
||||
|
||||
var qualityType = _qualityTypeProvider.Get((int)subject.Quality.Quality);
|
||||
var qualityType = _qualityTypeProvider.Get((int)subject.ParsedEpisodeInfo.Quality.Quality);
|
||||
|
||||
if (qualityType.MaxSize == 0)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using NLog;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
|
@ -24,10 +23,10 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
|
||||
public virtual bool IsSatisfiedBy(RemoteEpisode subject)
|
||||
{
|
||||
_logger.Trace("Checking if report meets language requirements. {0}", subject.Language);
|
||||
if (subject.Language != Language.English)
|
||||
_logger.Trace("Checking if report meets language requirements. {0}", subject.ParsedEpisodeInfo.Language);
|
||||
if (subject.ParsedEpisodeInfo.Language != Language.English)
|
||||
{
|
||||
_logger.Trace("Report Language: {0} rejected because it is not English", subject.Language);
|
||||
_logger.Trace("Report Language: {0} rejected because it is not English", subject.ParsedEpisodeInfo.Language);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.Download;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
|
@ -27,7 +24,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
}
|
||||
}
|
||||
|
||||
public virtual bool IsSatisfiedBy(RemoteEpisode subject)
|
||||
public bool IsSatisfiedBy(RemoteEpisode subject)
|
||||
{
|
||||
var downloadClient = _downloadClientProvider.GetDownloadClient();
|
||||
|
||||
|
@ -36,25 +33,25 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
return !IsInQueue(subject, queue);
|
||||
}
|
||||
|
||||
public virtual bool IsInQueue(RemoteEpisode newEpisode, IEnumerable<ParsedEpisodeInfo> queue)
|
||||
private bool IsInQueue(RemoteEpisode newEpisode, IEnumerable<ParsedEpisodeInfo> queue)
|
||||
{
|
||||
var matchingTitle = queue.Where(q => String.Equals(q.SeriesTitle, newEpisode.Series.CleanTitle, StringComparison.InvariantCultureIgnoreCase));
|
||||
|
||||
var matchingTitleWithQuality = matchingTitle.Where(q => q.Quality >= newEpisode.Quality);
|
||||
var matchingTitleWithQuality = matchingTitle.Where(q => q.Quality >= newEpisode.ParsedEpisodeInfo.Quality);
|
||||
|
||||
if (newEpisode.Series.SeriesType == SeriesTypes.Daily)
|
||||
{
|
||||
return matchingTitleWithQuality.Any(q => q.AirDate.Value.Date == newEpisode.AirDate.Value.Date);
|
||||
return matchingTitleWithQuality.Any(q => q.AirDate.Value.Date == newEpisode.ParsedEpisodeInfo.AirDate.Value.Date);
|
||||
}
|
||||
|
||||
var matchingSeason = matchingTitleWithQuality.Where(q => q.SeasonNumber == newEpisode.SeasonNumber);
|
||||
var matchingSeason = matchingTitleWithQuality.Where(q => q.SeasonNumber == newEpisode.ParsedEpisodeInfo.SeasonNumber);
|
||||
|
||||
if (newEpisode.FullSeason)
|
||||
if (newEpisode.ParsedEpisodeInfo.FullSeason)
|
||||
{
|
||||
return matchingSeason.Any();
|
||||
}
|
||||
|
||||
return matchingSeason.Any(q => q.EpisodeNumbers != null && q.EpisodeNumbers.Any(e => newEpisode.EpisodeNumbers.Contains(e)));
|
||||
return matchingSeason.Any(q => q.EpisodeNumbers != null && q.EpisodeNumbers.Any(e => newEpisode.ParsedEpisodeInfo.EpisodeNumbers.Contains(e)));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,10 +24,10 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
|
||||
public virtual bool IsSatisfiedBy(RemoteEpisode subject)
|
||||
{
|
||||
_logger.Trace("Checking if report meets quality requirements. {0}", subject.Quality);
|
||||
if (!subject.Series.QualityProfile.Allowed.Contains(subject.Quality.Quality))
|
||||
_logger.Trace("Checking if report meets quality requirements. {0}", subject.ParsedEpisodeInfo.Quality);
|
||||
if (!subject.Series.QualityProfile.Allowed.Contains(subject.ParsedEpisodeInfo.Quality.Quality))
|
||||
{
|
||||
_logger.Trace("Quality {0} rejected by Series' quality profile", subject.Quality);
|
||||
_logger.Trace("Quality {0} rejected by Series' quality profile", subject.ParsedEpisodeInfo.Quality);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search
|
|||
|
||||
var episode = _episodeService.GetEpisode(dailySearchSpec.SeriesId, dailySearchSpec.Airtime);
|
||||
|
||||
if (!remoteEpisode.AirDate.HasValue || remoteEpisode.AirDate.Value != episode.AirDate.Value)
|
||||
if (!remoteEpisode.ParsedEpisodeInfo.AirDate.HasValue || remoteEpisode.ParsedEpisodeInfo.AirDate.Value.Date != episode.AirDate.Value.Date)
|
||||
{
|
||||
_logger.Trace("Episode AirDate does not match searched episode number, skipping.");
|
||||
return false;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
using NLog;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.DecisionEngine.Specifications.Search
|
||||
|
@ -28,7 +26,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search
|
|||
var singleEpisodeSpec = searchDefinitionBase as SeasonSearchDefinition;
|
||||
if (singleEpisodeSpec == null) return true;
|
||||
|
||||
if (singleEpisodeSpec.SeasonNumber != remoteEpisode.SeasonNumber)
|
||||
if (singleEpisodeSpec.SeasonNumber != remoteEpisode.ParsedEpisodeInfo.SeasonNumber)
|
||||
{
|
||||
_logger.Trace("Season number does not match searched season number, skipping.");
|
||||
return false;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
using System.Linq;
|
||||
using NLog;
|
||||
using NzbDrone.Core.IndexerSearch.Definitions;
|
||||
using NzbDrone.Core.Model;
|
||||
using NzbDrone.Core.Parser;
|
||||
using NzbDrone.Core.Parser.Model;
|
||||
|
||||
namespace NzbDrone.Core.DecisionEngine.Specifications.Search
|
||||
|
@ -29,7 +27,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications.Search
|
|||
var singleEpisodeSpec = searchDefinitionBase as SingleEpisodeSearchDefinition;
|
||||
if (singleEpisodeSpec == null) return true;
|
||||
|
||||
if (singleEpisodeSpec.SeasonNumber != remoteEpisode.SeasonNumber)
|
||||
if (singleEpisodeSpec.SeasonNumber != remoteEpisode.ParsedEpisodeInfo.SeasonNumber)
|
||||
{
|
||||
_logger.Trace("Season number does not match searched season number, skipping.");
|
||||
return false;
|
||||
|
|
|
@ -30,12 +30,12 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
{
|
||||
_logger.Trace("Comparing file quality with report. Existing file is {0}", file.Quality);
|
||||
|
||||
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, file.Quality, subject.Quality))
|
||||
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, file.Quality, subject.ParsedEpisodeInfo.Quality))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (subject.Quality.Proper && file.DateAdded < DateTime.Today.AddDays(-7))
|
||||
if (subject.ParsedEpisodeInfo.Quality.Proper && file.DateAdded < DateTime.Today.AddDays(-7))
|
||||
{
|
||||
_logger.Trace("Proper for old file, skipping: {0}", subject);
|
||||
return false;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace NzbDrone.Core.DecisionEngine.Specifications
|
|||
if (bestQualityInHistory != null)
|
||||
{
|
||||
_logger.Trace("Comparing history quality with report. History is {0}", bestQualityInHistory);
|
||||
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, bestQualityInHistory, subject.Quality))
|
||||
if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, bestQualityInHistory, subject.ParsedEpisodeInfo.Quality))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue