update next up limit

pull/702/head
Luke Pulverenti 8 years ago
parent 2bfd6d3be0
commit e50fbdfafc

@ -50,6 +50,11 @@ namespace MediaBrowser.Server.Implementations.TV
} }
} }
if (string.IsNullOrWhiteSpace(presentationUniqueKey) && limit.HasValue)
{
limit = limit.Value + 10;
}
var items = _libraryManager.GetItemList(new InternalItemsQuery(user) var items = _libraryManager.GetItemList(new InternalItemsQuery(user)
{ {
IncludeItemTypes = new[] { typeof(Series).Name }, IncludeItemTypes = new[] { typeof(Series).Name },
@ -89,6 +94,11 @@ namespace MediaBrowser.Server.Implementations.TV
} }
} }
if (string.IsNullOrWhiteSpace(presentationUniqueKey) && limit.HasValue)
{
limit = limit.Value + 10;
}
var items = _libraryManager.GetItemList(new InternalItemsQuery(user) var items = _libraryManager.GetItemList(new InternalItemsQuery(user)
{ {
IncludeItemTypes = new[] { typeof(Series).Name }, IncludeItemTypes = new[] { typeof(Series).Name },
@ -115,7 +125,8 @@ namespace MediaBrowser.Server.Implementations.TV
.Where(i => i.Item1 != null && (!i.Item3 || !string.IsNullOrWhiteSpace(request.SeriesId))) .Where(i => i.Item1 != null && (!i.Item3 || !string.IsNullOrWhiteSpace(request.SeriesId)))
.OrderByDescending(i => i.Item2) .OrderByDescending(i => i.Item2)
.ThenByDescending(i => i.Item1.PremiereDate ?? DateTime.MinValue) .ThenByDescending(i => i.Item1.PremiereDate ?? DateTime.MinValue)
.Select(i => i.Item1); .Select(i => i.Item1)
.Take(request.Limit ?? int.MaxValue);
} }
private string GetUniqueSeriesKey(BaseItem series) private string GetUniqueSeriesKey(BaseItem series)

Loading…
Cancel
Save