diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-22 18:13:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-22 18:13:47 -0500 |
| commit | 28483bdb54be96ae83e0fded097f534d7e26ba1e (patch) | |
| tree | e7f4b92326417ebf55eecdf68a01d2c3b9e660d7 /MediaBrowser.Model/Net/MimeTypes.cs | |
| parent | 920c39454c05e979eabe81877269cd4517a03ccf (diff) | |
| parent | 8106c8393b711a7e1d40487e3caf2b014decbe28 (diff) | |
Merge pull request #651 from jellyfin/release-10.1.0
Release 10.1.0
Diffstat (limited to 'MediaBrowser.Model/Net/MimeTypes.cs')
| -rw-r--r-- | MediaBrowser.Model/Net/MimeTypes.cs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index c22e77beb..fe13413e2 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -1,8 +1,8 @@ -using MediaBrowser.Model.Extensions; using System; using System.Collections.Generic; using System.IO; using System.Linq; +using MediaBrowser.Model.Extensions; namespace MediaBrowser.Model.Net { @@ -48,7 +48,7 @@ namespace MediaBrowser.Model.Net private static Dictionary<string, string> GetVideoFileExtensionsDictionary() { - Dictionary<string, string> dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + var dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); foreach (string ext in VideoFileExtensions) { @@ -65,7 +65,7 @@ namespace MediaBrowser.Model.Net private static Dictionary<string, string> GetMimeTypeLookup() { - Dictionary<string, string> dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); + var dict = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); dict.Add(".jpg", "image/jpeg"); dict.Add(".jpeg", "image/jpeg"); @@ -127,13 +127,12 @@ namespace MediaBrowser.Model.Net { if (string.IsNullOrEmpty(path)) { - throw new ArgumentNullException("path"); + throw new ArgumentNullException(nameof(path)); } var ext = Path.GetExtension(path) ?? string.Empty; - string result; - if (MimeTypeLookup.TryGetValue(ext, out result)) + if (MimeTypeLookup.TryGetValue(ext, out string result)) { return result; } @@ -333,14 +332,13 @@ namespace MediaBrowser.Model.Net { if (string.IsNullOrEmpty(mimeType)) { - throw new ArgumentNullException("mimeType"); + throw new ArgumentNullException(nameof(mimeType)); } // handle text/html; charset=UTF-8 mimeType = mimeType.Split(';')[0]; - string result; - if (ExtensionLookup.TryGetValue(mimeType, out result)) + if (ExtensionLookup.TryGetValue(mimeType, out string result)) { return result; } |
