mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-03 01:01:34 +02:00
Fixed bug in history check.
This commit is contained in:
@@ -79,7 +79,8 @@ namespace NzbDrone.Core.Test
|
||||
|
||||
|
||||
var repo = MockLib.GetEmptyRepository();
|
||||
var history = Builder<History>.CreateNew().Build();
|
||||
var history = Builder<History>.CreateNew()
|
||||
.With(h => h.Quality = QualityTypes.Bluray720p).Build();
|
||||
repo.Add(history);
|
||||
mocker.SetConstant(repo);
|
||||
|
||||
@@ -88,6 +89,7 @@ namespace NzbDrone.Core.Test
|
||||
|
||||
//Assert
|
||||
Assert.IsNotNull(result);
|
||||
result.QualityType.Should().Be(QualityTypes.Bluray720p);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@@ -49,8 +49,8 @@ namespace NzbDrone.Core.Providers
|
||||
|
||||
public virtual Quality GetBestQualityInHistory(long episodeId)
|
||||
{
|
||||
var history = AllItems().Where(c => c.EpisodeId == episodeId).Select(d => new Quality() { QualityType = d.Quality, Proper = d.IsProper }).ToList();
|
||||
history.Sort();
|
||||
var history = AllItems().Where(c => c.EpisodeId == episodeId).ToList().Select(d => new Quality(d.Quality, d.IsProper));
|
||||
history.OrderBy(q => q);
|
||||
return history.FirstOrDefault();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user