update user views
This commit is contained in:
parent
032891c9f3
commit
45c8f51a9c
|
@ -121,10 +121,9 @@ namespace MediaBrowser.Controller.Channels
|
|||
/// <summary>
|
||||
/// Gets the channel folder.
|
||||
/// </summary>
|
||||
/// <param name="userId">The user identifier.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>BaseItemDto.</returns>
|
||||
Task<Folder> GetInternalChannelFolder(string userId, CancellationToken cancellationToken);
|
||||
Task<Folder> GetInternalChannelFolder(CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channel folder.
|
||||
|
|
|
@ -14,6 +14,8 @@ namespace MediaBrowser.Controller.Entities
|
|||
public string ViewType { get; set; }
|
||||
public Guid ParentId { get; set; }
|
||||
|
||||
public Guid? UserId { get; set; }
|
||||
|
||||
public static ITVSeriesManager TVSeriesManager;
|
||||
public static IPlaylistManager PlaylistManager;
|
||||
|
||||
|
|
|
@ -1399,12 +1399,12 @@ namespace MediaBrowser.Server.Implementations.Channels
|
|||
{
|
||||
var user = string.IsNullOrEmpty(userId) ? null : _userManager.GetUserById(userId);
|
||||
|
||||
var folder = await GetInternalChannelFolder(userId, cancellationToken).ConfigureAwait(false);
|
||||
var folder = await GetInternalChannelFolder(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
return _dtoService.GetBaseItemDto(folder, new DtoOptions(), user);
|
||||
}
|
||||
|
||||
public async Task<Folder> GetInternalChannelFolder(string userId, CancellationToken cancellationToken)
|
||||
public async Task<Folder> GetInternalChannelFolder(CancellationToken cancellationToken)
|
||||
{
|
||||
var name = _localization.GetLocalizedString("ViewTypeChannels");
|
||||
|
||||
|
|
|
@ -1670,8 +1670,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
string sortName,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var path = Path.Combine(ConfigurationManager.ApplicationPaths.ItemsByNamePath,
|
||||
"views");
|
||||
var path = Path.Combine(ConfigurationManager.ApplicationPaths.ItemsByNamePath, "views");
|
||||
|
||||
path = Path.Combine(path, _fileSystem.GetValidFilename(viewType));
|
||||
|
||||
|
|
|
@ -141,12 +141,13 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
|
||||
if (user.Configuration.DisplayFoldersView)
|
||||
{
|
||||
list.Add(await GetUserView(new List<ICollectionFolder>(), list, CollectionType.Folders, "zz_" + CollectionType.Folders, user, cancellationToken).ConfigureAwait(false));
|
||||
var name = _localizationManager.GetLocalizedString("ViewType" + CollectionType.Folders);
|
||||
list.Add(await _libraryManager.GetNamedView(name, CollectionType.Folders, string.Empty, cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
if (query.IncludeExternalContent)
|
||||
{
|
||||
var channelResult = await _channelManager.GetChannels(new ChannelQuery
|
||||
var channelResult = await _channelManager.GetChannelsInternal(new ChannelQuery
|
||||
{
|
||||
UserId = query.UserId
|
||||
|
||||
|
@ -155,14 +156,14 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
var channels = channelResult.Items;
|
||||
|
||||
var embeddedChannels = channels
|
||||
.Where(i => user.Configuration.DisplayChannelsWithinViews.Contains(i.Id))
|
||||
.Where(i => user.Configuration.DisplayChannelsWithinViews.Contains(i.Id.ToString("N")))
|
||||
.ToList();
|
||||
|
||||
list.AddRange(embeddedChannels.Select(i => _channelManager.GetChannel(i.Id)));
|
||||
list.AddRange(embeddedChannels);
|
||||
|
||||
if (channels.Length > embeddedChannels.Count)
|
||||
{
|
||||
list.Add(await _channelManager.GetInternalChannelFolder(query.UserId, cancellationToken).ConfigureAwait(false));
|
||||
list.Add(await _channelManager.GetInternalChannelFolder(cancellationToken).ConfigureAwait(false));
|
||||
}
|
||||
|
||||
if (_liveTvManager.GetEnabledUsers().Select(i => i.Id.ToString("N")).Contains(query.UserId))
|
||||
|
|
|
@ -72,6 +72,7 @@ namespace MediaBrowser.Server.Implementations.UserViews
|
|||
|
||||
var result = await view.GetItems(new InternalItemsQuery
|
||||
{
|
||||
User = (view.UserId.HasValue ? _userManager.GetUserById(view.UserId.Value) : null),
|
||||
CollapseBoxSetItems = false,
|
||||
Recursive = recursive,
|
||||
ExcludeItemTypes = new[] { "UserView", "CollectionFolder", "Playlist" }
|
||||
|
|
Loading…
Reference in New Issue
Block a user