mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 13:57:14 -04:00
Small optimization to child count field
This commit is contained in:
parent
fa366f0099
commit
e3f0a53f59
@ -370,6 +370,12 @@ namespace Emby.Server.Implementations.Dto
|
|||||||
if (item is MusicAlbum || item is Season || item is Playlist)
|
if (item is MusicAlbum || item is Season || item is Playlist)
|
||||||
{
|
{
|
||||||
dto.ChildCount = dto.RecursiveItemCount;
|
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))
|
if (options.ContainsField(ItemFields.ChildCount))
|
||||||
|
Loading…
Reference in New Issue
Block a user