From 994cc020f8cc3ff2fa566dce5a9df096bcaabd31 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 19 Oct 2015 22:06:05 -0400 Subject: restore video grouping feature --- .../Channels/ChannelManager.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Channels') diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs index 70005725f..99d2a03f9 100644 --- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs +++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs @@ -433,6 +433,7 @@ namespace MediaBrowser.Server.Implementations.Channels } var item = _libraryManager.GetItemById(id) as Channel; + var channelId = channelInfo.Name.GetMD5().ToString("N"); if (item == null) { @@ -443,13 +444,12 @@ namespace MediaBrowser.Server.Implementations.Channels DateCreated = _fileSystem.GetCreationTimeUtc(path), DateModified = _fileSystem.GetLastWriteTimeUtc(path), Path = path, - ChannelId = channelInfo.Name.GetMD5().ToString("N") + ChannelId = channelId }; isNew = true; } - var channelId = channelInfo.Name.GetMD5().ToString("N"); if (!string.Equals(item.ChannelId, channelId, StringComparison.OrdinalIgnoreCase)) { isNew = true; @@ -459,7 +459,7 @@ namespace MediaBrowser.Server.Implementations.Channels item.Overview = channelInfo.Description; item.HomePageUrl = channelInfo.HomePageUrl; - if (string.IsNullOrEmpty(item.Name)) + if (string.IsNullOrWhiteSpace(item.Name)) { item.Name = channelInfo.Name; } @@ -497,9 +497,14 @@ namespace MediaBrowser.Server.Implementations.Channels public IEnumerable GetAllChannelFeatures() { - return GetAllChannels() - .Select(GetChannelEntity) - .OrderBy(i => i.SortName) + var inputItems = _libraryManager.GetItems(new InternalItemsQuery + { + IncludeItemTypes = new[] { typeof(Channel).Name }, + SortBy = new[] { ItemSortBy.SortName } + + }).Items; + + return inputItems .Select(i => GetChannelFeatures(i.Id.ToString("N"))); } -- cgit v1.2.3