mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-04-24 22:17:25 -04:00
Merge pull request #6977 from Bond-009/mime
This commit is contained in:
commit
bdf9bdb9e6
2 changed files with 3 additions and 8 deletions
|
@ -116,7 +116,7 @@ namespace MediaBrowser.Model.Net
|
||||||
{ "audio/x-wavpack", ".wv" },
|
{ "audio/x-wavpack", ".wv" },
|
||||||
|
|
||||||
// Type image
|
// Type image
|
||||||
{ "image/jpg", ".jpg" },
|
{ "image/jpeg", ".jpg" },
|
||||||
{ "image/x-png", ".png" },
|
{ "image/x-png", ".png" },
|
||||||
|
|
||||||
// Type text
|
// Type text
|
||||||
|
@ -137,7 +137,7 @@ namespace MediaBrowser.Model.Net
|
||||||
/// <param name="filename">The filename to find the MIME type of.</param>
|
/// <param name="filename">The filename to find the MIME type of.</param>
|
||||||
/// <param name="defaultValue">The default value to return if no fitting MIME type is found.</param>
|
/// <param name="defaultValue">The default value to return if no fitting MIME type is found.</param>
|
||||||
/// <returns>The correct MIME type for the given filename, or <paramref name="defaultValue"/> if it wasn't found.</returns>
|
/// <returns>The correct MIME type for the given filename, or <paramref name="defaultValue"/> if it wasn't found.</returns>
|
||||||
[return: NotNullIfNotNullAttribute("defaultValue")]
|
[return: NotNullIfNotNull("defaultValue")]
|
||||||
public static string? GetMimeType(string filename, string? defaultValue = null)
|
public static string? GetMimeType(string filename, string? defaultValue = null)
|
||||||
{
|
{
|
||||||
if (filename.Length == 0)
|
if (filename.Length == 0)
|
||||||
|
|
|
@ -1,8 +1,3 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using MediaBrowser.Model.Net;
|
using MediaBrowser.Model.Net;
|
||||||
using Xunit;
|
using Xunit;
|
||||||
|
|
||||||
|
@ -129,7 +124,7 @@ namespace Jellyfin.Model.Tests.Net
|
||||||
[InlineData("font/woff2", ".woff2")]
|
[InlineData("font/woff2", ".woff2")]
|
||||||
[InlineData("image/bmp", ".bmp")]
|
[InlineData("image/bmp", ".bmp")]
|
||||||
[InlineData("image/gif", ".gif")]
|
[InlineData("image/gif", ".gif")]
|
||||||
[InlineData("image/jpg", ".jpg")]
|
[InlineData("image/jpeg", ".jpg")]
|
||||||
[InlineData("image/png", ".png")]
|
[InlineData("image/png", ".png")]
|
||||||
[InlineData("image/svg+xml", ".svg")]
|
[InlineData("image/svg+xml", ".svg")]
|
||||||
[InlineData("image/tiff", ".tif")]
|
[InlineData("image/tiff", ".tif")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue