mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-09 07:10:34 +02:00
Remove exception handler
This commit is contained in:
parent
766d2ee413
commit
a6cd852675
|
@ -73,8 +73,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|||
[FromQuery] int? limit,
|
||||
[FromQuery] string providerName,
|
||||
[FromQuery] bool includeAllLanguages)
|
||||
{
|
||||
try
|
||||
{
|
||||
var item = _libraryManager.GetItemById(id);
|
||||
if (item == null)
|
||||
|
@ -121,11 +119,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|||
result.Images = imageArray;
|
||||
return Ok(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets available remote image providers for an item.
|
||||
|
@ -137,8 +130,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
||||
public IActionResult GetRemoteImageProviders([FromRoute] string id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var item = _libraryManager.GetItemById(id);
|
||||
if (item == null)
|
||||
|
@ -149,11 +140,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|||
var providers = _providerManager.GetRemoteImageProviderInfo(item);
|
||||
return Ok(providers);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a remote image.
|
||||
|
@ -165,8 +151,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<IActionResult> GetRemoteImage([FromQuery, BindRequired] string imageUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
var urlHash = imageUrl.GetMD5();
|
||||
var pointerCachePath = GetFullCachePath(urlHash.ToString());
|
||||
|
@ -205,11 +189,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|||
var contentType = MimeTypes.GetMimeType(contentPath);
|
||||
return new FileStreamResult(System.IO.File.OpenRead(contentPath), contentType);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Downloads a remote image for an item.
|
||||
|
@ -226,8 +205,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|||
[FromRoute] string id,
|
||||
[FromQuery, BindRequired] ImageType type,
|
||||
[FromQuery] string imageUrl)
|
||||
{
|
||||
try
|
||||
{
|
||||
var item = _libraryManager.GetItemById(id);
|
||||
if (item == null)
|
||||
|
@ -241,11 +218,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|||
item.UpdateToRepository(ItemUpdateType.ImageUpdate, CancellationToken.None);
|
||||
return Ok();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the full cache path.
|
||||
|
|
Loading…
Reference in a new issue