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