mirror of
https://github.com/Sonarr/Sonarr
synced 2026-05-08 13:01:10 +02:00
Fixed: api/v3/history/series "includeSeries" and "includeEpisode" query parameters
Closes #4727
This commit is contained in:
parent
19510c4932
commit
b70ef368db
1 changed files with 8 additions and 4 deletions
|
|
@ -58,7 +58,9 @@ public List<EpisodeHistory> FindByDownloadId(string downloadId)
|
|||
|
||||
public List<EpisodeHistory> GetBySeries(int seriesId, EpisodeHistoryEventType? eventType)
|
||||
{
|
||||
var query = Query.Where(h => h.SeriesId == seriesId);
|
||||
var query = Query.Join<EpisodeHistory, Series>(JoinType.Inner, h => h.Series, (h, s) => h.SeriesId == s.Id)
|
||||
.Join<EpisodeHistory, Episode>(JoinType.Inner, h => h.Episode, (h, e) => h.EpisodeId == e.Id)
|
||||
.Where(h => h.SeriesId == seriesId);
|
||||
|
||||
if (eventType.HasValue)
|
||||
{
|
||||
|
|
@ -70,9 +72,11 @@ public List<EpisodeHistory> GetBySeries(int seriesId, EpisodeHistoryEventType? e
|
|||
|
||||
public List<EpisodeHistory> GetBySeason(int seriesId, int seasonNumber, EpisodeHistoryEventType? eventType)
|
||||
{
|
||||
var query = Query.Join<EpisodeHistory, Episode>(JoinType.Inner, h => h.Episode, (h, e) => h.EpisodeId == e.Id)
|
||||
.Where(h => h.SeriesId == seriesId)
|
||||
.AndWhere(h => h.Episode.SeasonNumber == seasonNumber);
|
||||
SortBuilder<EpisodeHistory> query = Query
|
||||
.Join<EpisodeHistory, Episode>(JoinType.Inner, h => h.Episode, (h, e) => h.EpisodeId == e.Id)
|
||||
.Join<EpisodeHistory, Series>(JoinType.Inner, h => h.Series, (h, s) => h.SeriesId == s.Id)
|
||||
.Where(h => h.SeriesId == seriesId)
|
||||
.AndWhere(h => h.Episode.SeasonNumber == seasonNumber);
|
||||
|
||||
if (eventType.HasValue)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue