From 78e5fdf3bced32514556adb9ed3eb53ec91531ea Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Wed, 31 Jan 2018 20:09:04 +0100 Subject: [PATCH] Added: Files downloaded with different quality than grabbed will get rejected. Fixes #1779, Fixes #2087, Fixes #1321 --- .../DownloadedMoviesImportServiceFixture.cs | 15 ++-- .../DownloadedMovieImportService.cs | 4 +- .../IImportDecisionEngineSpecification.cs | 3 +- .../EpisodeImport/ImportDecisionMaker.cs | 31 ++++---- .../Manual/ManualImportService.cs | 24 ++++-- .../Specifications/FreeSpaceSpecification.cs | 3 +- .../Specifications/FullSeasonSpecification.cs | 3 +- .../GrabbedReleaseQualitySpecification.cs | 73 +++++++++++++++++++ .../MatchesFolderSpecification.cs | 3 +- .../Specifications/NotSampleSpecification.cs | 3 +- .../NotUnpackingSpecification.cs | 3 +- .../SameEpisodesImportSpecification.cs | 3 +- .../UnverifiedSceneNumberingSpecification.cs | 3 +- .../Specifications/UpgradeSpecification.cs | 3 +- src/NzbDrone.Core/NzbDrone.Core.csproj | 3 +- 15 files changed, 137 insertions(+), 40 deletions(-) create mode 100644 src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualitySpecification.cs diff --git a/src/NzbDrone.Core.Test/MediaFiles/DownloadedMoviesImportServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/DownloadedMoviesImportServiceFixture.cs index 75c3a641b..d05c5b58c 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/DownloadedMoviesImportServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/DownloadedMoviesImportServiceFixture.cs @@ -14,6 +14,7 @@ using NzbDrone.Core.Tv; using NzbDrone.Test.Common; using FluentAssertions; +using NzbDrone.Core.Download; namespace NzbDrone.Core.Test.MediaFiles { @@ -77,7 +78,7 @@ public void should_skip_if_no_series_found() Subject.ProcessRootFolder(new DirectoryInfo(_droneFactory)); Mocker.GetMock() - .Verify(c => c.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), It.IsAny()), + .Verify(c => c.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()), Times.Never()); VerifyNoImport(); @@ -128,7 +129,7 @@ public void should_not_delete_folder_if_files_were_imported_and_video_files_rema imported.Add(new ImportDecision(localMovie)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), null, true)) .Returns(imported); Mocker.GetMock() @@ -154,7 +155,7 @@ public void should_delete_folder_if_files_were_imported_and_only_sample_files_re imported.Add(new ImportDecision(localMovie)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), null, true)) .Returns(imported); Mocker.GetMock() @@ -226,7 +227,7 @@ public void should_not_delete_if_there_is_large_rar_file() imported.Add(new ImportDecision(localMovie)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), null, true)) .Returns(imported); Mocker.GetMock() @@ -280,7 +281,7 @@ public void should_use_folder_if_folder_import() Subject.ProcessPath(fileName); Mocker.GetMock() - .Verify(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), true, false), Times.Once()); + .Verify(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), It.IsAny(), true, false), Times.Once()); } [Test] @@ -304,7 +305,7 @@ public void should_not_use_folder_if_file_import() var result = Subject.ProcessPath(fileName); Mocker.GetMock() - .Verify(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true, false), Times.Once()); + .Verify(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), null, true, false), Times.Once()); } [Test] @@ -337,7 +338,7 @@ public void should_not_delete_if_no_files_were_imported() imported.Add(new ImportDecision(localMovie)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), null, true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), It.IsAny(), null, true)) .Returns(imported); Mocker.GetMock() diff --git a/src/NzbDrone.Core/MediaFiles/DownloadedMovieImportService.cs b/src/NzbDrone.Core/MediaFiles/DownloadedMovieImportService.cs index c75020b77..7a1a3bcca 100644 --- a/src/NzbDrone.Core/MediaFiles/DownloadedMovieImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/DownloadedMovieImportService.cs @@ -187,7 +187,7 @@ private List ProcessFolder(DirectoryInfo directoryInfo, ImportMode } } - var decisions = _importDecisionMaker.GetImportDecisions(videoFiles.ToList(), movie, folderInfo, true, false); + var decisions = _importDecisionMaker.GetImportDecisions(videoFiles.ToList(), movie, null, folderInfo, true, false); var importResults = _importApprovedMovie.Import(decisions, true, downloadClientItem, importMode); if ((downloadClientItem == null || !downloadClientItem.IsReadOnly) && @@ -241,7 +241,7 @@ private List ProcessFile(FileInfo fileInfo, ImportMode importMode, } } - var decisions = _importDecisionMaker.GetImportDecisions(new List() { fileInfo.FullName }, movie, null, true, false); + var decisions = _importDecisionMaker.GetImportDecisions(new List() { fileInfo.FullName }, movie, null, null, true, false); return _importApprovedMovie.Import(decisions, true, downloadClientItem, importMode); } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/IImportDecisionEngineSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/IImportDecisionEngineSpecification.cs index 4dc6bcaf6..268f504a9 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/IImportDecisionEngineSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/IImportDecisionEngineSpecification.cs @@ -1,4 +1,5 @@ using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.EpisodeImport @@ -7,6 +8,6 @@ public interface IImportDecisionEngineSpecification { Decision IsSatisfiedBy(LocalEpisode localEpisode); - Decision IsSatisfiedBy(LocalMovie localMovie); + Decision IsSatisfiedBy(LocalMovie localMovie, DownloadClientItem downloadClientItem); } } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs index 8e44b1eb0..091d79ec6 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs @@ -6,6 +6,7 @@ using NzbDrone.Common.Disk; using NzbDrone.Common.Extensions; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Qualities; @@ -20,8 +21,8 @@ public interface IMakeImportDecision List GetImportDecisions(List videoFiles, Series series); List GetImportDecisions(List videoFiles, Movie movie); List GetImportDecisions(List videoFiles, Movie movie, bool shouldCheckQuality); - List GetImportDecisions(List videoFiles, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource, bool shouldCheckQuality); - List GetImportDecisions(List videoFiles, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource); + List GetImportDecisions(List videoFiles, Movie movie, DownloadClientItem downloadClientItem, ParsedMovieInfo folderInfo, bool sceneSource, bool shouldCheckQuality); + List GetImportDecisions(List videoFiles, Movie movie, DownloadClientItem downloadClientItem, ParsedMovieInfo folderInfo, bool sceneSource); List GetImportDecisions(List videoFiles, Series series, ParsedEpisodeInfo folderInfo, bool sceneSource); } @@ -62,12 +63,12 @@ public List GetImportDecisions(List videoFiles, Series s public List GetImportDecisions(List videoFiles, Movie movie) { - return GetImportDecisions(videoFiles, movie, null, true, false); + return GetImportDecisions(videoFiles, movie, null, null, true, false); } public List GetImportDecisions(List videoFiles, Movie movie, bool shouldCheckQuality = false) { - return GetImportDecisions(videoFiles, movie, null, true, shouldCheckQuality); + return GetImportDecisions(videoFiles, movie, null, null, true, shouldCheckQuality); } public List GetImportDecisions(List videoFiles, Series series, ParsedEpisodeInfo folderInfo, bool sceneSource) @@ -87,7 +88,7 @@ public List GetImportDecisions(List videoFiles, Series s return decisions; } - public List GetImportDecisions(List videoFiles, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource) + public List GetImportDecisions(List videoFiles, Movie movie, DownloadClientItem downloadClientItem, ParsedMovieInfo folderInfo, bool sceneSource) { var newFiles = _mediaFileService.FilterExistingFiles(videoFiles.ToList(), movie); @@ -98,13 +99,13 @@ public List GetImportDecisions(List videoFiles, Movie mo foreach (var file in newFiles) { - decisions.AddIfNotNull(GetDecision(file, movie, folderInfo, sceneSource, shouldUseFolderName)); + decisions.AddIfNotNull(GetDecision(file, movie, downloadClientItem, folderInfo, sceneSource, shouldUseFolderName)); } return decisions; } - public List GetImportDecisions(List videoFiles, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource, bool shouldCheckQuality = false) + public List GetImportDecisions(List videoFiles, Movie movie, DownloadClientItem downloadClientItem, ParsedMovieInfo folderInfo, bool sceneSource, bool shouldCheckQuality) { var newFiles = _mediaFileService.FilterExistingFiles(videoFiles.ToList(), movie); @@ -115,13 +116,13 @@ public List GetImportDecisions(List videoFiles, Movie mo foreach (var file in newFiles) { - decisions.AddIfNotNull(GetDecision(file, movie, folderInfo, sceneSource, shouldUseFolderName, shouldCheckQuality)); + decisions.AddIfNotNull(GetDecision(file, movie, downloadClientItem, folderInfo, sceneSource, shouldUseFolderName, shouldCheckQuality)); } return decisions; } - private ImportDecision GetDecision(string file, Movie movie, ParsedMovieInfo folderInfo, bool sceneSource, bool shouldUseFolderName, bool shouldCheckQuality = false) + private ImportDecision GetDecision(string file, Movie movie, DownloadClientItem downloadClientItem, ParsedMovieInfo folderInfo, bool sceneSource, bool shouldUseFolderName, bool shouldCheckQuality = false) { ImportDecision decision = null; @@ -283,11 +284,11 @@ private ImportDecision GetDecision(string file, Movie movie, ParsedMovieInfo fol - decision = GetDecision(localMovie); + decision = GetDecision(localMovie, downloadClientItem); } else { - decision = GetDecision(localMovie); + decision = GetDecision(localMovie, downloadClientItem); } } @@ -314,9 +315,9 @@ private ImportDecision GetDecision(string file, Movie movie, ParsedMovieInfo fol return decision; } - private ImportDecision GetDecision(LocalMovie localMovie) + private ImportDecision GetDecision(LocalMovie localMovie, DownloadClientItem downloadClientItem) { - var reasons = _specifications.Select(c => EvaluateSpec(c, localMovie)) + var reasons = _specifications.Select(c => EvaluateSpec(c, localMovie, downloadClientItem)) .Where(c => c != null); return new ImportDecision(localMovie, reasons.ToArray()); @@ -385,11 +386,11 @@ private ImportDecision GetDecision(LocalEpisode localEpisode) return new ImportDecision(localEpisode, reasons.ToArray()); } - private Rejection EvaluateSpec(IImportDecisionEngineSpecification spec, LocalMovie localMovie) + private Rejection EvaluateSpec(IImportDecisionEngineSpecification spec, LocalMovie localMovie, DownloadClientItem downloadClientItem) { try { - var result = spec.IsSatisfiedBy(localMovie); + var result = spec.IsSatisfiedBy(localMovie, downloadClientItem); if (!result.Accepted) { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs index d3bf2e99f..7cc815a5b 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Manual/ManualImportService.cs @@ -104,13 +104,19 @@ public List GetMediaFiles(string path, string downloadId) private List ProcessFolder(string folder, string downloadId) { + DownloadClientItem downloadClientItem = null; var directoryInfo = new DirectoryInfo(folder); var series = _parsingService.GetMovie(directoryInfo.Name); - if (series == null && downloadId.IsNotNullOrWhiteSpace()) + if (downloadId.IsNotNullOrWhiteSpace()) { var trackedDownload = _trackedDownloadService.Find(downloadId); - series = trackedDownload.RemoteMovie.Movie; + downloadClientItem = trackedDownload.DownloadItem; + + if (series == null) + { + series = trackedDownload.RemoteMovie.Movie; + } } if (series == null) @@ -122,7 +128,7 @@ private List ProcessFolder(string folder, string downloadId) var folderInfo = Parser.Parser.ParseMovieTitle(directoryInfo.Name, _config.ParsingLeniency > 0); var seriesFiles = _diskScanService.GetVideoFiles(folder).ToList(); - var decisions = _importDecisionMaker.GetImportDecisions(seriesFiles, series, folderInfo, SceneSource(series, folder), false); + var decisions = _importDecisionMaker.GetImportDecisions(seriesFiles, series, downloadClientItem, folderInfo, SceneSource(series, folder), false); return decisions.Select(decision => MapItem(decision, folder, downloadId)).ToList(); } @@ -134,6 +140,7 @@ private ManualImportItem ProcessFile(string file, string downloadId, string fold folder = new FileInfo(file).Directory.FullName; } + DownloadClientItem downloadClientItem = null; var relativeFile = folder.GetRelativePath(file); var movie = _parsingService.GetMovie(relativeFile.Split('\\', '/')[0]); @@ -143,10 +150,15 @@ private ManualImportItem ProcessFile(string file, string downloadId, string fold movie = _parsingService.GetMovie(relativeFile); } - if (movie == null && downloadId.IsNotNullOrWhiteSpace()) + if (downloadId.IsNotNullOrWhiteSpace()) { var trackedDownload = _trackedDownloadService.Find(downloadId); - movie = trackedDownload.RemoteMovie.Movie; + downloadClientItem = trackedDownload.DownloadItem; + + if (movie == null) + { + movie = trackedDownload.RemoteMovie.Movie; + } } if (movie == null) @@ -162,7 +174,7 @@ private ManualImportItem ProcessFile(string file, string downloadId, string fold } var importDecisions = _importDecisionMaker.GetImportDecisions(new List { file }, - movie, null, SceneSource(movie, folder), true); + movie, downloadClientItem, null, SceneSource(movie, folder), true); return importDecisions.Any() ? MapItem(importDecisions.First(), folder, downloadId) : new ManualImportItem { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs index 1e8432e84..7db4624ee 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs @@ -4,6 +4,7 @@ using NzbDrone.Common.Disk; using NzbDrone.Core.Configuration; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications @@ -64,7 +65,7 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode) return Decision.Accept(); } - public Decision IsSatisfiedBy(LocalMovie localMovie) + public Decision IsSatisfiedBy(LocalMovie localMovie, DownloadClientItem downloadClientItem) { if (_configService.SkipFreeSpaceCheckWhenImporting) { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FullSeasonSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FullSeasonSpecification.cs index 2daeda6cb..9b0bb2094 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FullSeasonSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FullSeasonSpecification.cs @@ -1,5 +1,6 @@ using NLog; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications @@ -24,7 +25,7 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode) return Decision.Accept(); } - public Decision IsSatisfiedBy(LocalMovie localMovie) + public Decision IsSatisfiedBy(LocalMovie localMovie, DownloadClientItem downloadClientItem) { return Decision.Accept(); } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualitySpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualitySpecification.cs new file mode 100644 index 000000000..73f282e30 --- /dev/null +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/GrabbedReleaseQualitySpecification.cs @@ -0,0 +1,73 @@ +using System.Linq; +using NLog; +using NzbDrone.Common.Extensions; +using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; +using NzbDrone.Core.History; +using NzbDrone.Core.Parser.Model; +using NzbDrone.Core.Qualities; + +namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications +{ + public class GrabbedReleaseQualitySpecification : IImportDecisionEngineSpecification + { + private readonly Logger _logger; + private readonly IHistoryService _historyService; + + public GrabbedReleaseQualitySpecification(Logger logger, IHistoryService historyService) + { + _logger = logger; + _historyService = historyService; + } + + public Decision IsSatisfiedBy(LocalEpisode localEpisode) + { + var qualityComparer = new QualityModelComparer(localEpisode.Series.Profile); + if (localEpisode.Episodes.Any(e => e.EpisodeFileId != 0 && qualityComparer.Compare(e.EpisodeFile.Value.Quality, localEpisode.Quality) > 0)) + { + _logger.Debug("This file isn't an upgrade for all episodes. Skipping {0}", localEpisode.Path); + return Decision.Reject("Not an upgrade for existing episode file(s)"); + } + + return Decision.Accept(); + } + + public Decision IsSatisfiedBy(LocalMovie localEpisode, DownloadClientItem downloadClientItem) + { + if (downloadClientItem == null) + { + _logger.Debug("No download client item provided, skipping."); + return Decision.Accept(); + } + + var grabbedHistory = _historyService.FindByDownloadId(downloadClientItem.DownloadId) + .Where(h => h.EventType == HistoryEventType.Grabbed) + .ToList(); + + if (grabbedHistory.Empty()) + { + _logger.Debug("No grabbed history for this download client item"); + return Decision.Accept(); + } + + var parsedReleaseName = Parser.Parser.ParseTitle(grabbedHistory.First().SourceTitle); + + if (parsedReleaseName != null && parsedReleaseName.FullSeason) + { + _logger.Debug("File is part of a season pack, skipping."); + return Decision.Accept(); + } + + foreach (var item in grabbedHistory) + { + if (item.Quality.Quality != Quality.Unknown && item.Quality != localEpisode.Quality) + { + _logger.Debug("Quality for grabbed release ({0}) does not match the quality of the file ({1})", item.Quality, localEpisode.Quality); + return Decision.Reject("File quality does not match quality of the grabbed release"); + } + } + + return Decision.Accept(); + } + } +} diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs index 55a8da073..da7f57607 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/MatchesFolderSpecification.cs @@ -3,6 +3,7 @@ using System.Linq; using NLog; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications @@ -16,7 +17,7 @@ public MatchesFolderSpecification(Logger logger) _logger = logger; } - public Decision IsSatisfiedBy(LocalMovie localMovie) + public Decision IsSatisfiedBy(LocalMovie localMovie, DownloadClientItem downloadClientItem) { if (localMovie.ExistingFile) { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotSampleSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotSampleSpecification.cs index ed8859cde..4846f4421 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotSampleSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotSampleSpecification.cs @@ -1,5 +1,6 @@ using NLog; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications @@ -38,7 +39,7 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode) return Decision.Accept(); } - public Decision IsSatisfiedBy(LocalMovie localEpisode) + public Decision IsSatisfiedBy(LocalMovie localEpisode, DownloadClientItem downloadClientItem) { var sample = _detectSample.IsSample(localEpisode.Movie, localEpisode.Quality, diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotUnpackingSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotUnpackingSpecification.cs index a19359457..152195a1b 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotUnpackingSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotUnpackingSpecification.cs @@ -5,6 +5,7 @@ using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Core.Configuration; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications @@ -57,7 +58,7 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode) return Decision.Accept(); } - public Decision IsSatisfiedBy(LocalMovie localEpisode) + public Decision IsSatisfiedBy(LocalMovie localEpisode, DownloadClientItem downloadClientItem) { if (localEpisode.ExistingFile) { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/SameEpisodesImportSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/SameEpisodesImportSpecification.cs index c24d62aaa..306f9f43b 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/SameEpisodesImportSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/SameEpisodesImportSpecification.cs @@ -1,6 +1,7 @@ using System; using NLog; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications @@ -29,7 +30,7 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode) return Decision.Reject("Episode file on disk contains more episodes than this file contains"); } - public Decision IsSatisfiedBy(LocalMovie localMovie) + public Decision IsSatisfiedBy(LocalMovie localMovie, DownloadClientItem downloadClientItem) { return Decision.Accept(); } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UnverifiedSceneNumberingSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UnverifiedSceneNumberingSpecification.cs index 85becc0ba..1c025432b 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UnverifiedSceneNumberingSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UnverifiedSceneNumberingSpecification.cs @@ -2,6 +2,7 @@ using System.Linq; using NLog; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications { @@ -14,7 +15,7 @@ public UnverifiedSceneNumberingSpecification(Logger logger) _logger = logger; } - public Decision IsSatisfiedBy(LocalMovie localMovie) + public Decision IsSatisfiedBy(LocalMovie localMovie, DownloadClientItem downloadClientItem) { return Decision.Accept(); } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UpgradeSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UpgradeSpecification.cs index b2d2c2c33..cab30cdca 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UpgradeSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UpgradeSpecification.cs @@ -1,6 +1,7 @@ using System.Linq; using NLog; using NzbDrone.Core.DecisionEngine; +using NzbDrone.Core.Download; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Qualities; @@ -27,7 +28,7 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode) return Decision.Accept(); } - public Decision IsSatisfiedBy(LocalMovie localEpisode) + public Decision IsSatisfiedBy(LocalMovie localEpisode, DownloadClientItem downloadClientItem) { return Decision.Accept(); } diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index febdc3e10..ce684ca9b 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -128,6 +128,7 @@ + @@ -1392,4 +1393,4 @@ --> - + \ No newline at end of file