mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-21 21:20:39 +02:00
commit
8023ae615b
|
@ -305,14 +305,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public bool IsFolderGrouped(Guid id)
|
public bool IsFolderGrouped(Guid id)
|
||||||
{
|
{
|
||||||
var config = Configuration;
|
return Configuration.GroupedFolders.Select(i => new Guid(i)).Contains(id);
|
||||||
|
|
||||||
if (config.ExcludeFoldersFromGrouping != null)
|
|
||||||
{
|
|
||||||
return !config.ExcludeFoldersFromGrouping.Select(i => new Guid(i)).Contains(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return config.GroupedFolders.Select(i => new Guid(i)).Contains(id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using MediaBrowser.Model.Dlna;
|
using MediaBrowser.Model.Dlna;
|
||||||
using MediaBrowser.Model.Extensions;
|
using MediaBrowser.Model.Extensions;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using MediaBrowser.Model.MediaInfo;
|
||||||
|
|
||||||
namespace MediaBrowser.Model.Entities
|
namespace MediaBrowser.Model.Entities
|
||||||
{
|
{
|
||||||
|
@ -53,18 +53,22 @@ namespace MediaBrowser.Model.Entities
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Language))
|
if (!string.IsNullOrEmpty(Language))
|
||||||
{
|
{
|
||||||
attributes.Add(Language);
|
attributes.Add(StringHelper.FirstToUpper(Language));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Codec) && !StringHelper.EqualsIgnoreCase(Codec, "dca"))
|
if (!string.IsNullOrEmpty(Codec) && !StringHelper.EqualsIgnoreCase(Codec, "dca"))
|
||||||
{
|
{
|
||||||
attributes.Add(Codec);
|
attributes.Add(AudioCodec.GetFriendlyName(Codec));
|
||||||
}
|
}
|
||||||
if (!string.IsNullOrEmpty(Profile) && !StringHelper.EqualsIgnoreCase(Profile, "lc"))
|
else if (!string.IsNullOrEmpty(Profile) && !StringHelper.EqualsIgnoreCase(Profile, "lc"))
|
||||||
{
|
{
|
||||||
attributes.Add(Profile);
|
attributes.Add(Profile);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Channels.HasValue)
|
if (!string.IsNullOrEmpty(ChannelLayout))
|
||||||
|
{
|
||||||
|
attributes.Add(ChannelLayout);
|
||||||
|
}
|
||||||
|
else if (Channels.HasValue)
|
||||||
{
|
{
|
||||||
attributes.Add(StringHelper.ToStringCultureInvariant(Channels.Value) + " ch");
|
attributes.Add(StringHelper.ToStringCultureInvariant(Channels.Value) + " ch");
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,5 +125,10 @@ namespace MediaBrowser.Model.Extensions
|
||||||
|
|
||||||
return sb.ToString();
|
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 AAC = "aac";
|
||||||
public const string MP3 = "mp3";
|
public const string MP3 = "mp3";
|
||||||
public const string AC3 = "ac3";
|
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)
|
.GetChildren(user, true)
|
||||||
.OfType<CollectionFolder>()
|
.OfType<CollectionFolder>()
|
||||||
.Where(i => string.IsNullOrWhiteSpace(i.CollectionType) || string.Equals(i.CollectionType, view.ViewType, StringComparison.OrdinalIgnoreCase))
|
.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));
|
.SelectMany(i => GetTopParentsForQuery(i, user));
|
||||||
}
|
}
|
||||||
return new BaseItem[] { };
|
return new BaseItem[] { };
|
||||||
|
|
Loading…
Reference in a new issue