From edfc55fdf63304c047ca0946e93ffb5d12782e65 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 19 May 2016 01:20:47 -0400 Subject: fix content sometimes not appearing after restart --- MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'MediaBrowser.Server.Implementations/LiveTv') diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs index 23bf50072..fdf6599da 100644 --- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs +++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs @@ -1410,13 +1410,20 @@ namespace MediaBrowser.Server.Implementations.LiveTv .Where(i => i.IsVisibleStandalone(user)) .ToList(); + if (folders.Count == 0) + { + return new QueryResult(); + } + return _libraryManager.GetItemsResult(new InternalItemsQuery(user) { MediaTypes = new[] { MediaType.Video }, Recursive = true, AncestorIds = folders.Select(i => i.Id.ToString("N")).ToArray(), ExcludeLocationTypes = new[] { LocationType.Virtual }, - Limit = Math.Min(10, query.Limit ?? int.MaxValue) + Limit = Math.Min(10, query.Limit ?? int.MaxValue), + SortBy = new[] { ItemSortBy.DateCreated }, + SortOrder = SortOrder.Descending }); } -- cgit v1.2.3