diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-30 15:24:35 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-06-30 15:24:35 -0400 |
| commit | c273f5fd9c33415a1fa985222e43c9c02f3d36e5 (patch) | |
| tree | 80986b09bfc12a5018c9335df9ee0f07e7ba55e0 /MediaBrowser.Server.Implementations/Library/UserViewManager.cs | |
| parent | 8ae316a2f3333106921e7bc587bc990a8899c613 (diff) | |
fixes #860 - Add options to display channels directly within user views
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/UserViewManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/UserViewManager.cs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs index fc4b9eb4c..9ac82690b 100644 --- a/MediaBrowser.Server.Implementations/Library/UserViewManager.cs +++ b/MediaBrowser.Server.Implementations/Library/UserViewManager.cs @@ -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)); } |
