mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-14 11:23:42 +02:00
Fixed: History Since API endpoint
This commit is contained in:
parent
d09e5d8eb4
commit
60470b653a
@ -119,14 +119,22 @@ protected override IEnumerable<EpisodeHistory> PagedQuery(SqlBuilder builder) =>
|
||||
|
||||
public List<EpisodeHistory> Since(DateTime date, EpisodeHistoryEventType? eventType)
|
||||
{
|
||||
var builder = Builder().Where<EpisodeHistory>(x => x.Date >= date);
|
||||
var builder = Builder()
|
||||
.Join<EpisodeHistory, Series>((h, a) => h.SeriesId == a.Id)
|
||||
.Join<EpisodeHistory, Episode>((h, a) => h.EpisodeId == a.Id)
|
||||
.Where<EpisodeHistory>(x => x.Date >= date);
|
||||
|
||||
if (eventType.HasValue)
|
||||
{
|
||||
builder.Where<EpisodeHistory>(h => h.EventType == eventType);
|
||||
}
|
||||
|
||||
return Query(builder).OrderBy(h => h.Date).ToList();
|
||||
return _database.QueryJoined<EpisodeHistory, Series, Episode>(builder, (history, series, episode) =>
|
||||
{
|
||||
history.Series = series;
|
||||
history.Episode = episode;
|
||||
return history;
|
||||
}).OrderBy(h => h.Date).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user