update special folders
This commit is contained in:
parent
50f6ee1039
commit
0ac0d6b878
|
@ -21,22 +21,8 @@ namespace MediaBrowser.Server.Implementations.Devices
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return GetChildren(user, true).Any() &&
|
||||
base.IsVisible(user);
|
||||
}
|
||||
|
||||
public override bool IsHidden
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.IsHidden || !Children.Any();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsHiddenFromUser(User user)
|
||||
{
|
||||
return false;
|
||||
return base.IsVisible(user) && HasChildren();
|
||||
}
|
||||
|
||||
public override string CollectionType
|
||||
|
@ -48,6 +34,23 @@ namespace MediaBrowser.Server.Implementations.Devices
|
|||
{
|
||||
return typeof(CollectionFolder).Name;
|
||||
}
|
||||
|
||||
private bool? _hasChildren;
|
||||
private bool HasChildren()
|
||||
{
|
||||
if (!_hasChildren.HasValue)
|
||||
{
|
||||
_hasChildren = LibraryManager.GetItemIds(new InternalItemsQuery { ParentId = Id }).Count > 0;
|
||||
}
|
||||
|
||||
return _hasChildren.Value;
|
||||
}
|
||||
|
||||
protected override System.Threading.Tasks.Task ValidateChildrenInternal(IProgress<double> progress, System.Threading.CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, Controller.Providers.MetadataRefreshOptions refreshOptions, Controller.Providers.IDirectoryService directoryService)
|
||||
{
|
||||
_hasChildren = null;
|
||||
return base.ValidateChildrenInternal(progress, cancellationToken, recursive, refreshChildMetadata, refreshOptions, directoryService);
|
||||
}
|
||||
}
|
||||
|
||||
public class CameraUploadsDynamicFolder : IVirtualFolderCreator
|
||||
|
@ -65,7 +68,7 @@ namespace MediaBrowser.Server.Implementations.Devices
|
|||
{
|
||||
var path = Path.Combine(_appPaths.DataPath, "camerauploads");
|
||||
|
||||
_fileSystem.CreateDirectory(path);
|
||||
_fileSystem.CreateDirectory(path);
|
||||
|
||||
return new CameraUploadsFolder
|
||||
{
|
||||
|
|
|
@ -34,11 +34,6 @@ namespace MediaBrowser.Server.Implementations.Playlists
|
|||
}
|
||||
}
|
||||
|
||||
public override bool IsHiddenFromUser(User user)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string CollectionType
|
||||
{
|
||||
get { return Model.Entities.CollectionType.Playlists; }
|
||||
|
|
Loading…
Reference in New Issue
Block a user