aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Entities/MediaStream.cs
diff options
context:
space:
mode:
authorMark Monteiro <marknr.monteiro@protonmail.com>2020-06-26 10:12:22 -0400
committerMark Monteiro <marknr.monteiro@protonmail.com>2020-06-26 10:12:22 -0400
commit0e9164351b80b532b96fbf4edf98dbd483141183 (patch)
treea0c399755abe3f32943b77422e67927d99b5120e /MediaBrowser.Model/Entities/MediaStream.cs
parent4f6e5591ece8d9344385d13f923384abfc07b709 (diff)
parent57caa9fdba984d0c4813c642f2617be905205d49 (diff)
Merge remote-tracking branch 'upstream/master' into external-id-type
Diffstat (limited to 'MediaBrowser.Model/Entities/MediaStream.cs')
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs24
1 files changed, 20 insertions, 4 deletions
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index ac33f1da4..7a488005e 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -12,7 +13,7 @@ using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Model.Entities
{
/// <summary>
- /// Class MediaStream
+ /// Class MediaStream.
/// </summary>
public class MediaStream
{
@@ -113,7 +114,7 @@ namespace MediaBrowser.Model.Entities
{
if (Type == MediaStreamType.Audio)
{
- //if (!string.IsNullOrEmpty(Title))
+ // if (!string.IsNullOrEmpty(Title))
//{
// return AddLanguageIfNeeded(Title);
//}
@@ -124,6 +125,7 @@ namespace MediaBrowser.Model.Entities
{
attributes.Add(StringHelper.FirstToUpper(Language));
}
+
if (!string.IsNullOrEmpty(Codec) && !string.Equals(Codec, "dca", StringComparison.OrdinalIgnoreCase))
{
attributes.Add(AudioCodec.GetFriendlyName(Codec));
@@ -141,6 +143,7 @@ namespace MediaBrowser.Model.Entities
{
attributes.Add(Channels.Value.ToString(CultureInfo.InvariantCulture) + " ch");
}
+
if (IsDefault)
{
attributes.Add("Default");
@@ -207,7 +210,6 @@ namespace MediaBrowser.Model.Entities
if (Type == MediaStreamType.Video)
{
-
}
return null;
@@ -227,30 +229,37 @@ namespace MediaBrowser.Model.Entities
{
return "4K";
}
+
if (width >= 2500)
{
if (i.IsInterlaced)
{
return "1440i";
}
+
return "1440p";
}
+
if (width >= 1900 || height >= 1000)
{
if (i.IsInterlaced)
{
return "1080i";
}
+
return "1080p";
}
+
if (width >= 1260 || height >= 700)
{
if (i.IsInterlaced)
{
return "720i";
}
+
return "720p";
}
+
if (width >= 700 || height >= 440)
{
@@ -258,11 +267,13 @@ namespace MediaBrowser.Model.Entities
{
return "480i";
}
+
return "480p";
}
return "SD";
}
+
return null;
}
@@ -410,7 +421,10 @@ namespace MediaBrowser.Model.Entities
{
get
{
- if (Type != MediaStreamType.Subtitle) return false;
+ if (Type != MediaStreamType.Subtitle)
+ {
+ return false;
+ }
if (string.IsNullOrEmpty(Codec) && !IsExternal)
{
@@ -448,6 +462,7 @@ namespace MediaBrowser.Model.Entities
{
return false;
}
+
if (string.Equals(fromCodec, "ssa", StringComparison.OrdinalIgnoreCase))
{
return false;
@@ -458,6 +473,7 @@ namespace MediaBrowser.Model.Entities
{
return false;
}
+
if (string.Equals(toCodec, "ssa", StringComparison.OrdinalIgnoreCase))
{
return false;