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

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

@ -345,5 +345,23 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
Mocker.GetMock<IParsingService>()
.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)
{
if (folderInfo != null &&
new QualityModelComparer(series.Profile).Compare(folderInfo.Quality,
fileQuality) > 0)
folderInfo.Quality.Quality != Quality.Unknown &&
new QualityModelComparer(series.Profile).Compare(folderInfo.Quality, fileQuality) > 0)
{
_logger.Debug("Using quality from folder: {0}", folderInfo.Quality);
return folderInfo.Quality;

Loading…
Cancel
Save