aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Controller/Entities/User.cs9
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs18
-rw-r--r--MediaBrowser.Model/Extensions/StringHelper.cs5
-rw-r--r--MediaBrowser.Model/MediaInfo/AudioCodec.cs17
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs2
5 files changed, 35 insertions, 16 deletions
diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs
index e5b39003d..5c68308f5 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 9b814c5cc..64c7d9aa6 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 99bec68a7..9cde3bfa4 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 5353f2b3e..93aba2f43 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 f61bac42d..56d3bd4de 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<CollectionFolder>()
.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[] { };