Use .net constants

This commit is contained in:
Max 2024-11-19 21:28:15 -05:00
parent 96cf13060d
commit 1ba0b88703

View File

@ -203,7 +203,7 @@ namespace MediaBrowser.Providers.Manager
// First, check for imagecache special case // First, check for imagecache special case
if (url.Contains("/imagecache/", StringComparison.OrdinalIgnoreCase)) if (url.Contains("/imagecache/", StringComparison.OrdinalIgnoreCase))
{ {
contentType = "image/png"; contentType = MediaTypeNames.Image.Png;
return; return;
} }
@ -211,9 +211,9 @@ namespace MediaBrowser.Providers.Manager
var fileExtension = Path.GetExtension(url)?.ToLowerInvariant(); var fileExtension = Path.GetExtension(url)?.ToLowerInvariant();
contentType = fileExtension switch contentType = fileExtension switch
{ {
".jpg" or ".jpeg" => "image/jpeg", ".jpg" or ".jpeg" => MediaTypeNames.Image.Jpeg,
".png" => "image/png", ".png" => MediaTypeNames.Image.Png,
".gif" => "image/gif", ".gif" => MediaTypeNames.Image.Gif,
".webp" => "image/webp", ".webp" => "image/webp",
_ => null _ => null
}; };