From 630de12e5e486a71d5bf449636bb9129f9eecc98 Mon Sep 17 00:00:00 2001 From: Max <@> Date: Wed, 4 Dec 2024 10:08:41 -0500 Subject: [PATCH] Apply review changes --- MediaBrowser.Providers/Manager/ProviderManager.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/MediaBrowser.Providers/Manager/ProviderManager.cs b/MediaBrowser.Providers/Manager/ProviderManager.cs index a6f98840a8..62a74f076e 100644 --- a/MediaBrowser.Providers/Manager/ProviderManager.cs +++ b/MediaBrowser.Providers/Manager/ProviderManager.cs @@ -208,15 +208,8 @@ namespace MediaBrowser.Providers.Manager } // Deduce content type from file extension - var fileExtension = Path.GetExtension(url)?.ToLowerInvariant(); - contentType = fileExtension switch - { - ".jpg" or ".jpeg" => MediaTypeNames.Image.Jpeg, - ".png" => MediaTypeNames.Image.Png, - ".gif" => MediaTypeNames.Image.Gif, - ".webp" => "image/webp", - _ => null - }; + var fileExtension = MimeTypes.GetMimeType(new Uri(url).GetLeftPart(UriPartial.Path)); + contentType = fileExtension; if (string.IsNullOrEmpty(contentType)) {