aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Net/MimeTypes.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Model/Net/MimeTypes.cs')
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs22
1 files changed, 12 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs
index fe2fbe7e4..afe7351d3 100644
--- a/MediaBrowser.Model/Net/MimeTypes.cs
+++ b/MediaBrowser.Model/Net/MimeTypes.cs
@@ -8,12 +8,12 @@ using System.Linq;
namespace MediaBrowser.Model.Net
{
/// <summary>
- /// Class MimeTypes
+ /// Class MimeTypes.
/// </summary>
public static class MimeTypes
{
/// <summary>
- /// Any extension in this list is considered a video file
+ /// Any extension in this list is considered a video file.
/// </summary>
private static readonly HashSet<string> _videoFileExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
@@ -67,6 +67,7 @@ namespace MediaBrowser.Model.Net
{ ".m3u8", "application/x-mpegURL" },
{ ".map", "application/x-javascript" },
{ ".mobi", "application/x-mobipocket-ebook" },
+ { ".opf", "application/oebps-package+xml" },
{ ".pdf", "application/pdf" },
{ ".rar", "application/vnd.rar" },
{ ".srt", "application/x-subrip" },
@@ -99,6 +100,7 @@ namespace MediaBrowser.Model.Net
{ ".ssa", "text/x-ssa" },
{ ".css", "text/css" },
{ ".csv", "text/csv" },
+ { ".edl", "text/plain" },
{ ".rtf", "text/rtf" },
{ ".txt", "text/plain" },
{ ".vtt", "text/vtt" },
@@ -123,7 +125,7 @@ namespace MediaBrowser.Model.Net
{ ".wmv", "video/x-ms-wmv" },
// Type audio
- { ".aac", "audio/mp4" },
+ { ".aac", "audio/aac" },
{ ".ac3", "audio/ac3" },
{ ".ape", "audio/x-ape" },
{ ".dsf", "audio/dsf" },
@@ -161,16 +163,16 @@ namespace MediaBrowser.Model.Net
return dict;
}
- public static string GetMimeType(string path) => GetMimeType(path, true);
+ public static string? GetMimeType(string path) => GetMimeType(path, true);
/// <summary>
/// Gets the type of the MIME.
/// </summary>
- public static string GetMimeType(string path, bool enableStreamDefault)
+ public static string? GetMimeType(string path, bool enableStreamDefault)
{
- if (string.IsNullOrEmpty(path))
+ if (path.Length == 0)
{
- throw new ArgumentNullException(nameof(path));
+ throw new ArgumentException("String can't be empty.", nameof(path));
}
var ext = Path.GetExtension(path);
@@ -208,11 +210,11 @@ namespace MediaBrowser.Model.Net
return enableStreamDefault ? "application/octet-stream" : null;
}
- public static string ToExtension(string mimeType)
+ public static string? ToExtension(string mimeType)
{
- if (string.IsNullOrEmpty(mimeType))
+ if (mimeType.Length == 0)
{
- throw new ArgumentNullException(nameof(mimeType));
+ throw new ArgumentException("String can't be empty.", nameof(mimeType));
}
// handle text/html; charset=UTF-8