Merge pull request #1746 from MediaBrowser/dev

Dev
pull/702/head
Luke 9 years ago
commit 8023ae615b

@ -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]

@ -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");
}

@ -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);
}
}
}

@ -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();
}
}
}
}

@ -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[] { };

Loading…
Cancel
Save