diff options
Diffstat (limited to 'MediaBrowser.Model/Net')
| -rw-r--r-- | MediaBrowser.Model/Net/HttpResponse.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/Net/IAcceptSocket.cs | 3 | ||||
| -rw-r--r-- | MediaBrowser.Model/Net/ISocket.cs | 1 | ||||
| -rw-r--r-- | MediaBrowser.Model/Net/MimeTypes.cs | 20 |
4 files changed, 14 insertions, 11 deletions
diff --git a/MediaBrowser.Model/Net/HttpResponse.cs b/MediaBrowser.Model/Net/HttpResponse.cs index f4bd8e681..7c3d1d73d 100644 --- a/MediaBrowser.Model/Net/HttpResponse.cs +++ b/MediaBrowser.Model/Net/HttpResponse.cs @@ -59,6 +59,7 @@ namespace MediaBrowser.Model.Net { _disposable.Dispose(); } + GC.SuppressFinalize(this); } } } diff --git a/MediaBrowser.Model/Net/IAcceptSocket.cs b/MediaBrowser.Model/Net/IAcceptSocket.cs index 2b5d33dce..343e12ab6 100644 --- a/MediaBrowser.Model/Net/IAcceptSocket.cs +++ b/MediaBrowser.Model/Net/IAcceptSocket.cs @@ -12,9 +12,6 @@ namespace MediaBrowser.Model.Net void Listen(int backlog); void Bind(IpEndPointInfo endpoint); void Connect(IpEndPointInfo endPoint); - void StartAccept(Action<IAcceptSocket> onAccept, Func<bool> isClosed); - IAsyncResult BeginSendFile(string path, byte[] preBuffer, byte[] postBuffer, AsyncCallback callback, object state); - void EndSendFile(IAsyncResult result); } public class SocketCreateException : Exception diff --git a/MediaBrowser.Model/Net/ISocket.cs b/MediaBrowser.Model/Net/ISocket.cs index 71eb9914b..42550340b 100644 --- a/MediaBrowser.Model/Net/ISocket.cs +++ b/MediaBrowser.Model/Net/ISocket.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index 2f132cb37..c4dfd25ca 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -14,7 +14,7 @@ namespace MediaBrowser.Model.Net /// <summary> /// Any extension in this list is considered a video file - can be added to at runtime for extensibility /// </summary> - private static readonly List<string> VideoFileExtensions = new List<string> + private static readonly string[] VideoFileExtensions = new string[] { ".mkv", ".m2t", @@ -106,14 +106,15 @@ namespace MediaBrowser.Model.Net return dict; } + public static string GetMimeType(string path) + { + return GetMimeType(path, true); + } + /// <summary> /// Gets the type of the MIME. /// </summary> - /// <param name="path">The path.</param> - /// <returns>System.String.</returns> - /// <exception cref="ArgumentNullException">path</exception> - /// <exception cref="InvalidOperationException">Argument not supported: + path</exception> - public static string GetMimeType(string path) + public static string GetMimeType(string path, bool enableStreamDefault) { if (string.IsNullOrEmpty(path)) { @@ -329,7 +330,12 @@ namespace MediaBrowser.Model.Net return "application/ttml+xml"; } - return "application/octet-stream"; + if (enableStreamDefault) + { + return "application/octet-stream"; + } + + return null; } public static string ToExtension(string mimeType) |
