Skip to content

Commit 0ef28e5

Browse files
committed
Fixup tests
1 parent 06c7f60 commit 0ef28e5

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/Aggregation/Aggregators/Augmenters/Quality/AugmentQualityFromMediaInfoFixture.cs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,26 @@ public void should_return_null_if_media_info_width_is_zero()
3535
Subject.AugmentQuality(localEpisode, null).Should().Be(null);
3636
}
3737

38-
[TestCase(4096, 2160)] // True 4K
39-
[TestCase(4000, 2160)]
40-
[TestCase(3840, 2160)] // 4K UHD
41-
[TestCase(3200, 2160)]
42-
[TestCase(2000, 1080)]
43-
[TestCase(1920, 1080)] // Full HD
44-
[TestCase(1800, 1080)]
45-
[TestCase(1490, 720)]
46-
[TestCase(1280, 720)] // HD
47-
[TestCase(1200, 720)]
48-
[TestCase(800, 480)]
49-
[TestCase(720, 480)] // SDTV
50-
[TestCase(600, 480)]
51-
[TestCase(100, 480)]
52-
public void should_return_closest_resolution(int mediaInfoWidth, int expectedResolution)
38+
[TestCase(4096, 1, 2160)] // True 4K
39+
[TestCase(4000, 1, 2160)]
40+
[TestCase(3840, 1, 2160)] // 4K UHD
41+
[TestCase(3200, 1, 2160)]
42+
[TestCase(2000, 1, 1080)]
43+
[TestCase(1920, 1, 1080)] // Full HD
44+
[TestCase(1440, 1080, 1080)] // 4:3 FullHD
45+
[TestCase(1800, 1, 1080)]
46+
[TestCase(1490, 1, 720)]
47+
[TestCase(1280, 1, 720)] // HD
48+
[TestCase(1200, 1, 720)]
49+
[TestCase(800, 1, 480)]
50+
[TestCase(720, 1, 480)] // SDTV
51+
[TestCase(600, 1, 480)]
52+
[TestCase(100, 1, 480)]
53+
public void should_return_closest_resolution(int mediaInfoWidth, int mediaInfoHeight, int expectedResolution)
5354
{
5455
var mediaInfo = Builder<MediaInfoModel>.CreateNew()
5556
.With(m => m.Width = mediaInfoWidth)
57+
.With(m => m.Height = mediaInfoHeight)
5658
.Build();
5759

5860
var localEpisode = Builder<LocalEpisode>.CreateNew()

src/NzbDrone.Core/MediaFiles/EpisodeImport/Aggregation/Aggregators/Augmenters/Quality/AugmentQualityFromMediaInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public AugmentQualityResult AugmentQuality(LocalEpisode localEpisode, DownloadCl
4545
return AugmentQualityResult.ResolutionOnly(720, Confidence.MediaInfo);
4646
}
4747

48-
if (width > 0 || height > 0)
48+
if (width > 0 && height > 0)
4949
{
5050
_logger.Trace("Resolution {0}x{1} considered 480p", width, height);
5151
return AugmentQualityResult.ResolutionOnly(480, Confidence.MediaInfo);

0 commit comments

Comments
 (0)