mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-11 08:10:34 +02:00
Reduce indentation
This commit is contained in:
parent
d10de5b7f9
commit
0415d1ccef
|
@ -1406,9 +1406,12 @@ namespace Emby.Server.Implementations.Dto
|
||||||
var width = imageInfo.Width;
|
var width = imageInfo.Width;
|
||||||
var height = imageInfo.Height;
|
var height = imageInfo.Height;
|
||||||
|
|
||||||
// Fallback to the image processor if the image info is somehow incorrect
|
if (width > 0 && height > 0)
|
||||||
if (width <= 0 || height <= 0)
|
|
||||||
{
|
{
|
||||||
|
return (double)width / height;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback to the image processor if the image info is somehow incorrect
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var size = _imageProcessor.GetImageDimensions(item, imageInfo);
|
var size = _imageProcessor.GetImageDimensions(item, imageInfo);
|
||||||
|
@ -1418,16 +1421,14 @@ namespace Emby.Server.Implementations.Dto
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Failed to determine primary image aspect ratio for {ImagePath}", imageInfo.Path);
|
_logger.LogError(ex, "Failed to determine primary image aspect ratio for {ImagePath}", imageInfo.Path);
|
||||||
return item.GetDefaultPrimaryImageAspectRatio();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (width <= 0 || height <= 0)
|
if (width > 0 && height > 0)
|
||||||
{
|
{
|
||||||
return item.GetDefaultPrimaryImageAspectRatio();
|
return (double)width / height;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (double)width / height;
|
return item.GetDefaultPrimaryImageAspectRatio();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue