mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 13:57:14 -04:00
Use embedded title for other track types
This commit is contained in:
parent
0cd7cd611e
commit
1cf31229d8
@ -77,19 +77,17 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Type == MediaStreamType.Audio)
|
||||
switch (Type)
|
||||
{
|
||||
case MediaStreamType.Audio:
|
||||
{
|
||||
//if (!string.IsNullOrEmpty(Title))
|
||||
//{
|
||||
// return AddLanguageIfNeeded(Title);
|
||||
//}
|
||||
|
||||
var attributes = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(Language))
|
||||
{
|
||||
attributes.Add(StringHelper.FirstToUpper(Language));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Codec) && !string.Equals(Codec, "dca", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
attributes.Add(AudioCodec.GetFriendlyName(Codec));
|
||||
@ -107,15 +105,26 @@ namespace MediaBrowser.Model.Entities
|
||||
{
|
||||
attributes.Add(Channels.Value.ToString(CultureInfo.InvariantCulture) + " ch");
|
||||
}
|
||||
|
||||
if (IsDefault)
|
||||
{
|
||||
attributes.Add("Default");
|
||||
attributes.Add(string.IsNullOrEmpty(localizedDefault) ? "Default" : localizedDefault);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Title))
|
||||
{
|
||||
return attributes.AsEnumerable()
|
||||
// keep Tags that are not already in Title
|
||||
.Where(tag => Title.IndexOf(tag, StringComparison.OrdinalIgnoreCase) == -1)
|
||||
// attributes concatenation, starting with Title
|
||||
.Aggregate(new StringBuilder(Title), (builder, attr) => builder.Append(" - ").Append(attr))
|
||||
.ToString();
|
||||
}
|
||||
|
||||
return string.Join(" ", attributes);
|
||||
}
|
||||
|
||||
if (Type == MediaStreamType.Video)
|
||||
case MediaStreamType.Video:
|
||||
{
|
||||
var attributes = new List<string>();
|
||||
|
||||
@ -131,12 +140,21 @@ namespace MediaBrowser.Model.Entities
|
||||
attributes.Add(Codec.ToUpperInvariant());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Title))
|
||||
{
|
||||
return attributes.AsEnumerable()
|
||||
// keep Tags that are not already in Title
|
||||
.Where(tag => Title.IndexOf(tag, StringComparison.OrdinalIgnoreCase) == -1)
|
||||
// attributes concatenation, starting with Title
|
||||
.Aggregate(new StringBuilder(Title), (builder, attr) => builder.Append(" - ").Append(attr))
|
||||
.ToString();
|
||||
}
|
||||
|
||||
return string.Join(" ", attributes);
|
||||
}
|
||||
|
||||
if (Type == MediaStreamType.Subtitle)
|
||||
case MediaStreamType.Subtitle:
|
||||
{
|
||||
|
||||
var attributes = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(Language))
|
||||
@ -171,14 +189,11 @@ namespace MediaBrowser.Model.Entities
|
||||
return string.Join(" - ", attributes.ToArray());
|
||||
}
|
||||
|
||||
if (Type == MediaStreamType.Video)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string GetResolutionText()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user