cache ids in UserRootFolder

This commit is contained in:
Luke Pulverenti 2016-08-14 12:39:23 -04:00
parent fb779d89d2
commit 325a3cc844

View File

@ -18,20 +18,20 @@ namespace MediaBrowser.Controller.Entities
{
private List<Guid> _childrenIds = null;
private readonly object _childIdsLock = new object();
//protected override IEnumerable<BaseItem> LoadChildren()
//{
// lock (_childIdsLock)
// {
// if (_childrenIds == null)
// {
// var list = base.LoadChildren().ToList();
// _childrenIds = list.Select(i => i.Id).ToList();
// return list;
// }
protected override IEnumerable<BaseItem> LoadChildren()
{
lock (_childIdsLock)
{
if (_childrenIds == null)
{
var list = base.LoadChildren().ToList();
_childrenIds = list.Select(i => i.Id).ToList();
return list;
}
// return _childrenIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
// }
//}
return _childrenIds.Select(LibraryManager.GetItemById).Where(i => i != null).ToList();
}
}
private void ResetCachedChildren()
{