Missing will not include series and episodes that are not monitored

This commit is contained in:
Mark McDowall 2013-07-15 14:53:35 -07:00
commit 92bab993ae
4 changed files with 8 additions and 1 deletions

View file

@ -84,9 +84,12 @@ namespace NzbDrone.Core.Tv
startingSeasonNumber = 0;
}
var pagingQuery = Query.Where(e => e.EpisodeFileId == 0)
var pagingQuery = Query.Join<Episode, Series>(JoinType.Inner, e => e.Series, (e, s) => e.SeriesId == s.Id)
.Where(e => e.EpisodeFileId == 0)
.AndWhere(e => e.SeasonNumber >= startingSeasonNumber)
.AndWhere(e => e.AirDate <= currentTime)
.AndWhere(e => e.Monitored)
.AndWhere(e => e.Series.Monitored)
.OrderBy(pagingSpec.OrderByClause(), pagingSpec.ToSortDirection())
.Skip(pagingSpec.PagingOffset())
.Take(pagingSpec.PageSize);