Fixed Season Special import.

This commit is contained in:
Taloth Saldono 2018-01-22 21:34:59 +01:00
parent aa2174b43c
commit 7c95fc23d0
1 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,7 @@ using System.Linq;
using NLog; using NLog;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download; using NzbDrone.Core.Download;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
@ -10,10 +11,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
public class MatchesFolderSpecification : IImportDecisionEngineSpecification public class MatchesFolderSpecification : IImportDecisionEngineSpecification
{ {
private readonly Logger _logger; private readonly Logger _logger;
private readonly IParsingService _parsingService;
public MatchesFolderSpecification(Logger logger) public MatchesFolderSpecification(ParsingService parsingService, Logger logger)
{ {
_logger = logger; _logger = logger;
_parsingService = parsingService;
} }
public Decision IsSatisfiedBy(LocalEpisode localEpisode, DownloadClientItem downloadClientItem) public Decision IsSatisfiedBy(LocalEpisode localEpisode, DownloadClientItem downloadClientItem)
{ {
@ -31,6 +34,11 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
var folderInfo = Parser.Parser.ParseTitle(dirInfo.Name); var folderInfo = Parser.Parser.ParseTitle(dirInfo.Name);
if (folderInfo != null && folderInfo.IsPossibleSceneSeasonSpecial)
{
folderInfo = _parsingService.ParseSpecialEpisodeTitle(folderInfo, dirInfo.Name, localEpisode.Series.TvdbId, 0);
}
if (folderInfo == null) if (folderInfo == null)
{ {
return Decision.Accept(); return Decision.Accept();