1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-25 17:17:02 +00:00

Episodes between dates uses SQL join

This commit is contained in:
Mark McDowall 2013-05-29 21:06:24 -07:00
parent ee28c74ae2
commit de911005cb
2 changed files with 4 additions and 3 deletions

View file

@ -116,8 +116,9 @@ public List<Episode> EpisodesWithFiles()
public List<Episode> EpisodesBetweenDates(DateTime startDate, DateTime endDate)
{
return Query//.Join<Episode, Series>(JoinType.None, e => e.Series, (e, s) => e.SeriesId == s.Id);
.Where<Episode>(e => e.AirDate >= startDate && e.AirDate <= endDate).ToList();
return Query.Join<Episode, Series>(JoinType.Inner, e => e.Series, (e, s) => e.SeriesId == s.Id)
.Where<Episode>(e => e.AirDate >= startDate)
.AndWhere(e => e.AirDate <= endDate).ToList();
}
public void SetIgnoreFlat(Episode episode, bool ignoreFlag)

View file

@ -281,7 +281,7 @@ public List<Episode> EpisodesBetweenDates(DateTime start, DateTime end)
{
var episodes = _episodeRepository.EpisodesBetweenDates(start.ToUniversalTime(), end.ToUniversalTime());
return LinkSeriesToEpisodes(episodes);
return episodes;
}
public void HandleAsync(SeriesDeletedEvent message)