fixes #860 - Add options to display channels directly within user views

This commit is contained in:
Luke Pulverenti
2014-06-30 15:24:35 -04:00
parent 8ae316a2f3
commit c273f5fd9c
5 changed files with 19 additions and 6 deletions

View File

@@ -90,12 +90,19 @@ namespace MediaBrowser.Server.Implementations.Library
{
var channelResult = await _channelManager.GetChannels(new ChannelQuery
{
Limit = 0,
UserId = query.UserId
}, cancellationToken).ConfigureAwait(false);
if (channelResult.TotalRecordCount > 0)
var channels = channelResult.Items;
var embeddedChannels = channels
.Where(i => user.Configuration.DisplayChannelsWithinViews.Contains(i.Id))
.ToList();
list.AddRange(embeddedChannels.Select(i => _channelManager.GetChannel(i.Id)));
if (channels.Length > embeddedChannels.Count)
{
list.Add(await _channelManager.GetInternalChannelFolder(query.UserId, cancellationToken).ConfigureAwait(false));
}