mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Apply review changes
This commit is contained in:
parent
1ba0b88703
commit
630de12e5e
@ -208,15 +208,8 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Deduce content type from file extension
|
// Deduce content type from file extension
|
||||||
var fileExtension = Path.GetExtension(url)?.ToLowerInvariant();
|
var fileExtension = MimeTypes.GetMimeType(new Uri(url).GetLeftPart(UriPartial.Path));
|
||||||
contentType = fileExtension switch
|
contentType = fileExtension;
|
||||||
{
|
|
||||||
".jpg" or ".jpeg" => MediaTypeNames.Image.Jpeg,
|
|
||||||
".png" => MediaTypeNames.Image.Png,
|
|
||||||
".gif" => MediaTypeNames.Image.Gif,
|
|
||||||
".webp" => "image/webp",
|
|
||||||
_ => null
|
|
||||||
};
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(contentType))
|
if (string.IsNullOrEmpty(contentType))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user