mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Fix code
This commit is contained in:
parent
630de12e5e
commit
43fff5799b
@ -200,17 +200,18 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
// TODO: Isolate this hack into the tvh plugin
|
// TODO: Isolate this hack into the tvh plugin
|
||||||
if (string.IsNullOrEmpty(contentType))
|
if (string.IsNullOrEmpty(contentType))
|
||||||
{
|
{
|
||||||
// First, check for imagecache special case
|
// Special case for imagecache
|
||||||
if (url.Contains("/imagecache/", StringComparison.OrdinalIgnoreCase))
|
if (url.Contains("/imagecache/", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
contentType = MediaTypeNames.Image.Png;
|
contentType = MediaTypeNames.Image.Png;
|
||||||
return;
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Deduce content type from file extension
|
||||||
|
contentType = MimeTypes.GetMimeType(new Uri(url).GetLeftPart(UriPartial.Path));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deduce content type from file extension
|
// Throw if we still can't determine the content type
|
||||||
var fileExtension = MimeTypes.GetMimeType(new Uri(url).GetLeftPart(UriPartial.Path));
|
|
||||||
contentType = fileExtension;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(contentType))
|
if (string.IsNullOrEmpty(contentType))
|
||||||
{
|
{
|
||||||
throw new HttpRequestException("Invalid image received: contentType not set.", null, response.StatusCode);
|
throw new HttpRequestException("Invalid image received: contentType not set.", null, response.StatusCode);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user