mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-27 10:58:44 +01:00
Friendly stream names
This commit is contained in:
28
MediaBrowser.Model/Extensions/CodecHelper.cs
Normal file
28
MediaBrowser.Model/Extensions/CodecHelper.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Model.Extensions
|
||||
{
|
||||
public static class CodecHelper
|
||||
{
|
||||
public static string FriendlyName(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,5 +125,10 @@ namespace MediaBrowser.Model.Extensions
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
public static string FirstToUpper(this string str)
|
||||
{
|
||||
return string.IsNullOrEmpty(str) ? "" : str.Substring(0, 1).ToUpper() + str.Substring(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user