aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Entities
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-05-15 13:14:02 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-05-15 13:14:02 -0400
commit1e299549a8d459ffa6931617bb3d281f696e6062 (patch)
tree78b0738ba42347521227b28ef5c4fe5bb36aade4 /MediaBrowser.Model/Entities
parent780d5b914cc22bdf88477761e60c5de64b20504d (diff)
parent3dadeeae7b12be43ace187dede3d451e867b6c24 (diff)
Merge branch 'beta'
Diffstat (limited to 'MediaBrowser.Model/Entities')
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs91
1 files changed, 90 insertions, 1 deletions
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index fa7a51291..9b814c5cc 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -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>
@@ -42,6 +129,8 @@ namespace MediaBrowser.Model.Entities
/// <value><c>true</c> if this instance is interlaced; otherwise, <c>false</c>.</value>
public bool IsInterlaced { get; set; }
+ public bool? IsAVC { get; set; }
+
/// <summary>
/// Gets or sets the channel layout.
/// </summary>