From 5f1e0cf2d344d6fdbc18b09d6ab3552e208434c1 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 15 May 2016 15:55:17 -0400 Subject: [PATCH] optimize dlna queries --- MediaBrowser.Controller/Entities/UserViewBuilder.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index f58debf93..a4fe2e178 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -399,8 +399,6 @@ namespace MediaBrowser.Controller.Entities query.SortBy = new string[] { }; - //var items = GetRecursiveChildren(parent, user, new[] { CollectionType.Music, CollectionType.MusicVideos }, i => i is MusicVideo || i is Audio.Audio && FilterItem(i, query)); - return PostFilterAndSort(items, parent, null, query); } @@ -599,9 +597,13 @@ namespace MediaBrowser.Controller.Entities { if (query.Recursive) { - var items = GetRecursiveChildren(parent, user, new[] { CollectionType.TvShows, string.Empty }, i => (i is Series || i is Season || i is Episode) && FilterItem(i, query)); + query.Recursive = true; + query.ParentId = parent.Id; + query.SetUser(user); - return PostFilterAndSort(items, parent, null, query); + query.IncludeItemTypes = new[] { typeof(Series).Name, typeof(Season).Name, typeof(Episode).Name }; + + return _libraryManager.GetItemsResult(query); } var list = new List();