Fixed: Ignore file quality matching release quality for unknown quality releases

This commit is contained in:
Mark McDowall 2017-05-17 21:15:21 -07:00
parent e8d01daf03
commit cf7ce9804f
No known key found for this signature in database
GPG Key ID: D4CEFA9A718052E0
2 changed files with 16 additions and 1 deletions

View File

@ -78,6 +78,20 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeTrue(); Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeTrue();
} }
[Test]
public void should_be_accepted_if_grabbed_history_quality_is_unknown()
{
var history = Builder<History.History>.CreateListOfSize(1)
.All()
.With(h => h.EventType = HistoryEventType.Grabbed)
.With(h => h.Quality = new QualityModel(Quality.Unknown))
.BuildList();
GivenHistory(history);
Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeTrue();
}
[Test] [Test]
public void should_be_accepted_if_grabbed_history_quality_matches() public void should_be_accepted_if_grabbed_history_quality_matches()
{ {

View File

@ -5,6 +5,7 @@ using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download; using NzbDrone.Core.Download;
using NzbDrone.Core.History; using NzbDrone.Core.History;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Qualities;
namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
{ {
@ -46,7 +47,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
foreach (var item in grabbedHistory) foreach (var item in grabbedHistory)
{ {
if (item.Quality != localEpisode.Quality) 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); _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.Reject("File quality does not match quality of the grabbed release");