aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/UserViewManager.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-11-11 09:56:31 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-11-11 09:56:31 -0500
commitcc19ce0daf3edb46d1acffdf2af98787cc9f7f5a (patch)
tree03055ae936c198e1ab85ca76c869fa39c96971c9 /MediaBrowser.Server.Implementations/Library/UserViewManager.cs
parentdb8e51edb63b05c79d51134157e94a5cab9951a2 (diff)
added new parent methods
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/UserViewManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/UserViewManager.cs17
1 files changed, 13 insertions, 4 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs
index 03ebcbbdc..b869d181e 100644
--- a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs
@@ -49,6 +49,15 @@ namespace MediaBrowser.Server.Implementations.Library
.OfType<Folder>()
.ToList();
+ if (!query.IncludeHidden)
+ {
+ folders = folders.Where(i =>
+ {
+ var hidden = i as IHiddenFromDisplay;
+ return hidden == null || !hidden.IsHiddenFromUser(user);
+ }).ToList();
+ }
+
var plainFolderIds = user.Configuration.PlainFolderViews.Select(i => new Guid(i)).ToList();
var standaloneFolders = folders
@@ -121,7 +130,7 @@ namespace MediaBrowser.Server.Implementations.Library
if (parents.Count > 0)
{
- list.Add(await GetUserView(parents, list, CollectionType.TvShows, string.Empty, user, enableUserViews, cancellationToken).ConfigureAwait(false));
+ list.Add(await GetUserView(parents, CollectionType.TvShows, string.Empty, user, enableUserViews, cancellationToken).ConfigureAwait(false));
}
parents = foldersWithViewTypes.Where(i => string.Equals(i.GetViewType(user), CollectionType.Movies, StringComparison.OrdinalIgnoreCase) || string.IsNullOrWhiteSpace(i.GetViewType(user)))
@@ -129,7 +138,7 @@ namespace MediaBrowser.Server.Implementations.Library
if (parents.Count > 0)
{
- list.Add(await GetUserView(parents, list, CollectionType.Movies, string.Empty, user, enableUserViews, cancellationToken).ConfigureAwait(false));
+ list.Add(await GetUserView(parents, CollectionType.Movies, string.Empty, user, enableUserViews, cancellationToken).ConfigureAwait(false));
}
if (user.Configuration.DisplayFoldersView)
@@ -194,7 +203,7 @@ namespace MediaBrowser.Server.Implementations.Library
return GetUserSubView(name, parentId, type, sortName, cancellationToken);
}
- private async Task<UserView> GetUserView(List<ICollectionFolder> parents, List<Folder> currentViews, string viewType, string sortName, User user, bool enableUserViews, CancellationToken cancellationToken)
+ private async Task<UserView> GetUserView(List<ICollectionFolder> parents, string viewType, string sortName, User user, bool enableUserViews, CancellationToken cancellationToken)
{
if (parents.Count == 1 && parents.All(i => string.Equals((enableUserViews ? i.GetViewType(user) : i.CollectionType), viewType, StringComparison.OrdinalIgnoreCase)))
{
@@ -305,7 +314,7 @@ namespace MediaBrowser.Server.Implementations.Library
ExcludeLocationTypes = new[] { LocationType.Virtual },
Limit = limit * 20
- }, user, parentIds);
+ }, parentIds);
}
}
}