diff options
| author | JPVenson <github@jpb.email> | 2025-09-20 15:19:26 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-20 07:19:26 -0600 |
| commit | 59f77c24c98fc0d28cde8367896226c12418fd8e (patch) | |
| tree | 08b233e8aea0628c5f8e633fade1474f3e3020b7 /MediaBrowser.Controller/Entities/Folder.cs | |
| parent | 0949212993974d3888e84c32e97a8058e896d051 (diff) | |
Revert limit hack (#14820)
Diffstat (limited to 'MediaBrowser.Controller/Entities/Folder.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index abb2aab63..ab0dd6820 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -1333,8 +1333,8 @@ namespace MediaBrowser.Controller.Entities private int AddChildrenFromCollection(IEnumerable<BaseItem> children, User user, bool includeLinkedChildren, Dictionary<Guid, BaseItem> result, bool recursive, InternalItemsQuery query, HashSet<Folder> visitedFolders) { query ??= new InternalItemsQuery(); - var limit = query.Limit; - query.Limit = 100; // this is a bit of a dirty hack thats in favor of specifically the webUI as it does not show more then +99 elements in its badges so there is no point in reading more then that. + var limit = query.Limit > 0 ? query.Limit : int.MaxValue; + query.Limit = 0; var visibileChildren = children .Where(e => e.IsVisible(user)) @@ -1343,12 +1343,12 @@ namespace MediaBrowser.Controller.Entities var realChildren = visibileChildren .Where(e => query is null || UserViewBuilder.FilterItem(e, query)) .ToArray(); - var childCount = realChildren.Count(); - if (result.Count < query.Limit) + var childCount = realChildren.Length; + if (result.Count < limit) { foreach (var child in realChildren .Skip(query.StartIndex ?? 0) - .TakeWhile(e => query.Limit >= result.Count)) + .TakeWhile(e => limit > result.Count)) { result[child.Id] = child; } |
