mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
removed sqo.
This commit is contained in:
parent
7717e32729
commit
1a4f3fad25
64 changed files with 292 additions and 1323 deletions
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
@ -13,22 +14,22 @@ namespace NzbDrone.Core.History
|
|||
|
||||
public class HistoryRepository : BasicRepository<History>, IHistoryRepository
|
||||
{
|
||||
public HistoryRepository(IObjectDatabase objectDatabase)
|
||||
: base(objectDatabase)
|
||||
public HistoryRepository(IDbConnection database)
|
||||
: base(database)
|
||||
{
|
||||
}
|
||||
|
||||
public void Trim()
|
||||
{
|
||||
var oldIds = Queryable.Where(c => c.Date < DateTime.Now.AddDays(-30).Date).Select(c => c.Id);
|
||||
var oldIds = Where(c => c.Date < DateTime.Now.AddDays(-30).Date).Select(c => c.Id);
|
||||
DeleteMany(oldIds);
|
||||
}
|
||||
|
||||
|
||||
public QualityModel GetBestQualityInHistory(int seriesId, int seasonNumber, int episodeNumber)
|
||||
{
|
||||
var history = Queryable.OrderByDescending(c => c.Quality).FirstOrDefault(c => c.Episode.Series.Id == seriesId && c.Episode.SeasonNumber == seasonNumber &&
|
||||
c.Episode.EpisodeNumber == episodeNumber);
|
||||
var history = Where(c => c.Episode.Series.Id == seriesId && c.Episode.SeasonNumber == seasonNumber && c.Episode.EpisodeNumber == episodeNumber)
|
||||
.OrderByDescending(c => c.Quality).FirstOrDefault();
|
||||
|
||||
if (history != null)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue