The Free Software Media System - Server Backend & API
Small optimization to child count field
cviume3f0a53f5983
diff --git a/Emby.Server.Implementations/Dto/DtoService.cs b/Emby.Server.Implementations/Dto/DtoService.csindex 67ecd04e0e..b91ff64087 100644--- a/Emby.Server.Implementations/Dto/DtoService.cs+++ b/Emby.Server.Implementations/Dto/DtoService.cs@@ -370,6 +370,12 @@ namespace Emby.Server.Implementations.Dtoif (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))