Fixed bug in history check.

pull/3113/head
kay.one 14 years ago
parent 54d1d5e379
commit 4c8b1d9604

@ -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();
}

Loading…
Cancel
Save