1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 04:22:30 +01:00

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

Closes #560
This commit is contained in:
Mark McDowall 2015-05-24 23:18:57 -07:00
parent 4a6778c609
commit bbcabf0632
2 changed files with 20 additions and 2 deletions

View File

@ -345,5 +345,23 @@ public void should_not_use_folder_name_if_file_name_is_scene_name()
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);
}
}
}

View File

@ -182,8 +182,8 @@ private bool ShouldUseFolderName(List<string> videoFiles, Series series, ParsedE
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;