Fixed: Don't use folder quality when it is unknown and file quality is

Closes #560
pull/2/head
Mark McDowall 10 years ago
parent 4a6778c609
commit bbcabf0632

@ -345,5 +345,23 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
Mocker.GetMock<IParsingService>() Mocker.GetMock<IParsingService>()
.Verify(c => c.GetLocalEpisode(It.IsAny<string>(), It.IsAny<Series>(), It.Is<ParsedEpisodeInfo>(p => p != null), true), Times.Never()); .Verify(c => c.GetLocalEpisode(It.IsAny<string>(), It.IsAny<Series>(), It.Is<ParsedEpisodeInfo>(p => p != null), true), Times.Never());
} }
[Test]
public void should_not_use_folder_quality_when_it_is_unknown()
{
GivenSpecifications(_pass1, _pass2, _pass3);
_series.Profile = new Profile
{
Items = Qualities.QualityFixture.GetDefaultQualities(Quality.DVD, Quality.Unknown)
};
var folderQuality = new QualityModel(Quality.Unknown);
var result = Subject.GetImportDecisions(_videoFiles, _series, new ParsedEpisodeInfo { Quality = folderQuality}, true);
result.Single().LocalEpisode.Quality.Should().Be(_quality);
}
} }
} }

@ -182,8 +182,8 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport
private QualityModel GetQuality(ParsedEpisodeInfo folderInfo, QualityModel fileQuality, Series series) private QualityModel GetQuality(ParsedEpisodeInfo folderInfo, QualityModel fileQuality, Series series)
{ {
if (folderInfo != null && if (folderInfo != null &&
new QualityModelComparer(series.Profile).Compare(folderInfo.Quality, folderInfo.Quality.Quality != Quality.Unknown &&
fileQuality) > 0) new QualityModelComparer(series.Profile).Compare(folderInfo.Quality, fileQuality) > 0)
{ {
_logger.Debug("Using quality from folder: {0}", folderInfo.Quality); _logger.Debug("Using quality from folder: {0}", folderInfo.Quality);
return folderInfo.Quality; return folderInfo.Quality;

Loading…
Cancel
Save