diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index e5b39003d0..5c68308f5c 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -305,14 +305,7 @@ namespace MediaBrowser.Controller.Entities public bool IsFolderGrouped(Guid id) { - var config = Configuration; - - if (config.ExcludeFoldersFromGrouping != null) - { - return !config.ExcludeFoldersFromGrouping.Select(i => new Guid(i)).Contains(id); - } - - return config.GroupedFolders.Select(i => new Guid(i)).Contains(id); + return Configuration.GroupedFolders.Select(i => new Guid(i)).Contains(id); } [IgnoreDataMember] diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs index 9b814c5ccc..64c7d9aa6c 100644 --- a/MediaBrowser.Model/Entities/MediaStream.cs +++ b/MediaBrowser.Model/Entities/MediaStream.cs @@ -1,8 +1,8 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using MediaBrowser.Model.Dlna; using MediaBrowser.Model.Extensions; using System.Diagnostics; +using MediaBrowser.Model.MediaInfo; namespace MediaBrowser.Model.Entities { @@ -53,18 +53,22 @@ namespace MediaBrowser.Model.Entities if (!string.IsNullOrEmpty(Language)) { - attributes.Add(Language); + attributes.Add(StringHelper.FirstToUpper(Language)); } if (!string.IsNullOrEmpty(Codec) && !StringHelper.EqualsIgnoreCase(Codec, "dca")) { - attributes.Add(Codec); - } - if (!string.IsNullOrEmpty(Profile) && !StringHelper.EqualsIgnoreCase(Profile, "lc")) + attributes.Add(AudioCodec.GetFriendlyName(Codec)); + } + else if (!string.IsNullOrEmpty(Profile) && !StringHelper.EqualsIgnoreCase(Profile, "lc")) { attributes.Add(Profile); } - if (Channels.HasValue) + if (!string.IsNullOrEmpty(ChannelLayout)) + { + attributes.Add(ChannelLayout); + } + else if (Channels.HasValue) { attributes.Add(StringHelper.ToStringCultureInvariant(Channels.Value) + " ch"); } diff --git a/MediaBrowser.Model/Extensions/StringHelper.cs b/MediaBrowser.Model/Extensions/StringHelper.cs index 99bec68a73..9cde3bfa45 100644 --- a/MediaBrowser.Model/Extensions/StringHelper.cs +++ b/MediaBrowser.Model/Extensions/StringHelper.cs @@ -125,5 +125,10 @@ namespace MediaBrowser.Model.Extensions return sb.ToString(); } + + public static string FirstToUpper(this string str) + { + return string.IsNullOrEmpty(str) ? "" : str.Substring(0, 1).ToUpper() + str.Substring(1); + } } } diff --git a/MediaBrowser.Model/MediaInfo/AudioCodec.cs b/MediaBrowser.Model/MediaInfo/AudioCodec.cs index 5353f2b3ec..93aba2f434 100644 --- a/MediaBrowser.Model/MediaInfo/AudioCodec.cs +++ b/MediaBrowser.Model/MediaInfo/AudioCodec.cs @@ -5,5 +5,22 @@ public const string AAC = "aac"; public const string MP3 = "mp3"; public const string AC3 = "ac3"; + + public static string GetFriendlyName(string codec) + { + if (string.IsNullOrEmpty(codec)) return ""; + + switch (codec.ToLower()) + { + case "ac3": + return "Dolby Digital"; + case "eac3": + return "Dolby Digital+"; + case "dca": + return "DTS"; + default: + return codec.ToUpper(); + } + } } } \ No newline at end of file diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index f61bac42dc..56d3bd4de1 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -1452,7 +1452,7 @@ namespace MediaBrowser.Server.Implementations.Library .GetChildren(user, true) .OfType() .Where(i => string.IsNullOrWhiteSpace(i.CollectionType) || string.Equals(i.CollectionType, view.ViewType, StringComparison.OrdinalIgnoreCase)) - .Where(i => user.Configuration.GroupedFolders.Contains(i.Id.ToString("N"), StringComparer.OrdinalIgnoreCase)) + .Where(i => user.IsFolderGrouped(i.Id)) .SelectMany(i => GetTopParentsForQuery(i, user)); } return new BaseItem[] { };