Merge pull request #6869 from cvium/optimize_childcount

Small optimization to child count field
pull/6871/head
Cody Robibero 3 years ago committed by GitHub
commit 4a7498a0be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -370,6 +370,12 @@ namespace Emby.Server.Implementations.Dto
if (item is MusicAlbum || item is Season || item is Playlist)
{
dto.ChildCount = dto.RecursiveItemCount;
var folderChildCount = folder.LinkedChildren.Length;
// The default is an empty array, so we can't reliably use the count when it's empty
if (folderChildCount > 0)
{
dto.ChildCount ??= folderChildCount;
}
}
if (options.ContainsField(ItemFields.ChildCount))

Loading…
Cancel
Save