mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
add additional view settings
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user