mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
cleaned up history lookup.
This commit is contained in:
parent
cd6f0fc55c
commit
b9fac94eca
7 changed files with 24 additions and 18 deletions
|
@ -9,7 +9,7 @@ namespace NzbDrone.Core.History
|
|||
public interface IHistoryRepository : IBasicRepository<History>
|
||||
{
|
||||
void Trim();
|
||||
QualityModel GetBestQualityInHistory(int seriesId, int seasonNumber, int episodeNumber);
|
||||
QualityModel GetBestQualityInHistory(int episodeId);
|
||||
}
|
||||
|
||||
public class HistoryRepository : BasicRepository<History>, IHistoryRepository
|
||||
|
@ -26,9 +26,9 @@ namespace NzbDrone.Core.History
|
|||
}
|
||||
|
||||
|
||||
public QualityModel GetBestQualityInHistory(int seriesId, int seasonNumber, int episodeNumber)
|
||||
public QualityModel GetBestQualityInHistory(int episodeId)
|
||||
{
|
||||
var history = Where(c => c.Episode.Series.Id == seriesId && c.Episode.SeasonNumber == seasonNumber && c.Episode.EpisodeNumber == episodeNumber)
|
||||
var history = Where(c => c.EpisodeId == episodeId)
|
||||
.OrderByDescending(c => c.Quality).FirstOrDefault();
|
||||
|
||||
if (history != null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue