|
|
|
@ -5,6 +5,7 @@ using NLog;
|
|
|
|
|
using NzbDrone.Common.Extensions;
|
|
|
|
|
using NzbDrone.Common.Instrumentation.Extensions;
|
|
|
|
|
using NzbDrone.Common.Serializer;
|
|
|
|
|
using NzbDrone.Core.DataAugmentation.Scene;
|
|
|
|
|
using NzbDrone.Core.DecisionEngine.Specifications;
|
|
|
|
|
using NzbDrone.Core.Download.Aggregation;
|
|
|
|
|
using NzbDrone.Core.IndexerSearch.Definitions;
|
|
|
|
@ -24,16 +25,19 @@ namespace NzbDrone.Core.DecisionEngine
|
|
|
|
|
private readonly IEnumerable<IDecisionEngineSpecification> _specifications;
|
|
|
|
|
private readonly IParsingService _parsingService;
|
|
|
|
|
private readonly IRemoteEpisodeAggregationService _aggregationService;
|
|
|
|
|
private readonly ISceneMappingService _sceneMappingService;
|
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
public DownloadDecisionMaker(IEnumerable<IDecisionEngineSpecification> specifications,
|
|
|
|
|
IParsingService parsingService,
|
|
|
|
|
IRemoteEpisodeAggregationService aggregationService,
|
|
|
|
|
ISceneMappingService sceneMappingService,
|
|
|
|
|
Logger logger)
|
|
|
|
|
{
|
|
|
|
|
_specifications = specifications;
|
|
|
|
|
_parsingService = parsingService;
|
|
|
|
|
_aggregationService = aggregationService;
|
|
|
|
|
_sceneMappingService = sceneMappingService;
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -88,7 +92,15 @@ namespace NzbDrone.Core.DecisionEngine
|
|
|
|
|
|
|
|
|
|
if (remoteEpisode.Series == null)
|
|
|
|
|
{
|
|
|
|
|
decision = new DownloadDecision(remoteEpisode, new Rejection("Unknown Series"));
|
|
|
|
|
var reason = "Unknown Series";
|
|
|
|
|
var matchingTvdbId = _sceneMappingService.FindTvdbId(parsedEpisodeInfo.SeriesTitle, parsedEpisodeInfo.ReleaseTitle);
|
|
|
|
|
|
|
|
|
|
if (matchingTvdbId.HasValue)
|
|
|
|
|
{
|
|
|
|
|
reason = $"{parsedEpisodeInfo.SeriesTitle} matches an alias for series with TVDB ID: {matchingTvdbId}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
decision = new DownloadDecision(remoteEpisode, new Rejection(reason));
|
|
|
|
|
}
|
|
|
|
|
else if (remoteEpisode.Episodes.Empty())
|
|
|
|
|
{
|
|
|
|
|