add additional view settings

This commit is contained in:
Luke Pulverenti
2014-07-01 00:06:28 -04:00
parent f77209cf77
commit 43943657b7
13 changed files with 114 additions and 40 deletions

View File

@@ -62,28 +62,29 @@ namespace MediaBrowser.Server.Implementations.Library
if (recursiveChildren.OfType<Series>().Any())
{
list.Add(await GetUserView(CollectionType.TvShows, user, cancellationToken).ConfigureAwait(false));
list.Add(await GetUserView(CollectionType.TvShows, user, string.Empty, cancellationToken).ConfigureAwait(false));
}
if (recursiveChildren.OfType<MusicAlbum>().Any() ||
recursiveChildren.OfType<MusicVideo>().Any())
{
list.Add(await GetUserView(CollectionType.Music, user, cancellationToken).ConfigureAwait(false));
list.Add(await GetUserView(CollectionType.Music, user, string.Empty, cancellationToken).ConfigureAwait(false));
}
if (recursiveChildren.OfType<Movie>().Any())
{
list.Add(await GetUserView(CollectionType.Movies, user, cancellationToken).ConfigureAwait(false));
list.Add(await GetUserView(CollectionType.Movies, user, string.Empty, cancellationToken).ConfigureAwait(false));
}
if (recursiveChildren.OfType<Game>().Any())
{
list.Add(await GetUserView(CollectionType.Games, user, cancellationToken).ConfigureAwait(false));
list.Add(await GetUserView(CollectionType.Games, user, string.Empty, cancellationToken).ConfigureAwait(false));
}
if (recursiveChildren.OfType<BoxSet>().Any())
if (user.Configuration.DisplayCollectionsView ||
recursiveChildren.OfType<BoxSet>().Any())
{
list.Add(await GetUserView(CollectionType.BoxSets, user, cancellationToken).ConfigureAwait(false));
list.Add(await GetUserView(CollectionType.BoxSets, user, "zzz_" + CollectionType.BoxSets, cancellationToken).ConfigureAwait(false));
}
if (query.IncludeExternalContent)
@@ -116,11 +117,11 @@ namespace MediaBrowser.Server.Implementations.Library
return list.OrderBy(i => i.SortName);
}
private Task<UserView> GetUserView(string type, User user, CancellationToken cancellationToken)
private Task<UserView> GetUserView(string type, User user, string sortName, CancellationToken cancellationToken)
{
var name = _localizationManager.GetLocalizedString("ViewType" + type);
return _libraryManager.GetNamedView(name, type, string.Empty, cancellationToken);
return _libraryManager.GetNamedView(name, type, sortName, cancellationToken);
}
}
}