mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 18:14:42 +01:00
add DisplayTitle to media streams
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Dlna;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
using System.Diagnostics;
|
||||
|
||||
@@ -34,6 +36,91 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <value>The comment.</value>
|
||||
public string Comment { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public string DisplayTitle
|
||||
{
|
||||
get
|
||||
{
|
||||
if (!string.IsNullOrEmpty(Title))
|
||||
{
|
||||
return Title;
|
||||
}
|
||||
|
||||
if (Type == MediaStreamType.Audio)
|
||||
{
|
||||
List<string> attributes = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(Language))
|
||||
{
|
||||
attributes.Add(Language);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Codec) && !StringHelper.EqualsIgnoreCase(Codec, "dca"))
|
||||
{
|
||||
attributes.Add(Codec);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Profile) && !StringHelper.EqualsIgnoreCase(Profile, "lc"))
|
||||
{
|
||||
attributes.Add(Profile);
|
||||
}
|
||||
|
||||
if (Channels.HasValue)
|
||||
{
|
||||
attributes.Add(StringHelper.ToStringCultureInvariant(Channels.Value) + " ch");
|
||||
}
|
||||
|
||||
string name = string.Join(" ", attributes.ToArray());
|
||||
|
||||
if (IsDefault)
|
||||
{
|
||||
name += " (D)";
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
if (Type == MediaStreamType.Subtitle)
|
||||
{
|
||||
List<string> attributes = new List<string>();
|
||||
|
||||
if (!string.IsNullOrEmpty(Language))
|
||||
{
|
||||
attributes.Add(Language);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Codec))
|
||||
{
|
||||
attributes.Add(Codec);
|
||||
}
|
||||
|
||||
string name = string.Join(" ", attributes.ToArray());
|
||||
|
||||
if (IsDefault)
|
||||
{
|
||||
name += " (D)";
|
||||
}
|
||||
|
||||
if (IsForced)
|
||||
{
|
||||
name += " (F)";
|
||||
}
|
||||
|
||||
if (IsExternal)
|
||||
{
|
||||
name += " (EXT)";
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
if (Type == MediaStreamType.Video)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string NalLengthSize { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user