|
|
@ -47,16 +47,9 @@ namespace Jellyfin.Api.Controllers.Images
|
|
|
|
[ProducesResponseType(typeof(ImageByNameInfo[]), StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(typeof(ImageByNameInfo[]), StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
public IActionResult GetGeneralImages()
|
|
|
|
public IActionResult GetGeneralImages()
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return Ok(GetImageList(_applicationPaths.GeneralPath, false));
|
|
|
|
return Ok(GetImageList(_applicationPaths.GeneralPath, false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Get General Image.
|
|
|
|
/// Get General Image.
|
|
|
@ -69,8 +62,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
public IActionResult GetGeneralImage([FromRoute] string name, [FromRoute] string type)
|
|
|
|
public IActionResult GetGeneralImage([FromRoute] string name, [FromRoute] string type)
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var filename = string.Equals(type, "primary", StringComparison.OrdinalIgnoreCase)
|
|
|
|
var filename = string.Equals(type, "primary", StringComparison.OrdinalIgnoreCase)
|
|
|
|
? "folder"
|
|
|
|
? "folder"
|
|
|
@ -88,11 +79,6 @@ namespace Jellyfin.Api.Controllers.Images
|
|
|
|
var contentType = MimeTypes.GetMimeType(path);
|
|
|
|
var contentType = MimeTypes.GetMimeType(path);
|
|
|
|
return new FileStreamResult(System.IO.File.OpenRead(path), contentType);
|
|
|
|
return new FileStreamResult(System.IO.File.OpenRead(path), contentType);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Get all general images.
|
|
|
|
/// Get all general images.
|
|
|
@ -102,16 +88,9 @@ namespace Jellyfin.Api.Controllers.Images
|
|
|
|
[ProducesResponseType(typeof(ImageByNameInfo[]), StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(typeof(ImageByNameInfo[]), StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
public IActionResult GetRatingImages()
|
|
|
|
public IActionResult GetRatingImages()
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return Ok(GetImageList(_applicationPaths.RatingsPath, false));
|
|
|
|
return Ok(GetImageList(_applicationPaths.RatingsPath, false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Get rating image.
|
|
|
|
/// Get rating image.
|
|
|
@ -126,16 +105,9 @@ namespace Jellyfin.Api.Controllers.Images
|
|
|
|
public IActionResult GetRatingImage(
|
|
|
|
public IActionResult GetRatingImage(
|
|
|
|
[FromRoute] string theme,
|
|
|
|
[FromRoute] string theme,
|
|
|
|
[FromRoute] string name)
|
|
|
|
[FromRoute] string name)
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return GetImageFile(_applicationPaths.RatingsPath, theme, name);
|
|
|
|
return GetImageFile(_applicationPaths.RatingsPath, theme, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Get all media info images.
|
|
|
|
/// Get all media info images.
|
|
|
@ -145,16 +117,9 @@ namespace Jellyfin.Api.Controllers.Images
|
|
|
|
[ProducesResponseType(typeof(ImageByNameInfo[]), StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(typeof(ImageByNameInfo[]), StatusCodes.Status200OK)]
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
public IActionResult GetMediaInfoImages()
|
|
|
|
public IActionResult GetMediaInfoImages()
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return Ok(GetImageList(_applicationPaths.MediaInfoImagesPath, false));
|
|
|
|
return Ok(GetImageList(_applicationPaths.MediaInfoImagesPath, false));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Get media info image.
|
|
|
|
/// Get media info image.
|
|
|
@ -169,16 +134,9 @@ namespace Jellyfin.Api.Controllers.Images
|
|
|
|
public IActionResult GetMediaInfoImage(
|
|
|
|
public IActionResult GetMediaInfoImage(
|
|
|
|
[FromRoute] string theme,
|
|
|
|
[FromRoute] string theme,
|
|
|
|
[FromRoute] string name)
|
|
|
|
[FromRoute] string name)
|
|
|
|
{
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return GetImageFile(_applicationPaths.MediaInfoImagesPath, theme, name);
|
|
|
|
return GetImageFile(_applicationPaths.MediaInfoImagesPath, theme, name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// Internal FileHelper.
|
|
|
|
/// Internal FileHelper.
|
|
|
|