mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
Clean api return types
This commit is contained in:
@@ -65,7 +65,7 @@ namespace Jellyfin.Api.Controllers
|
||||
[Produces(MediaTypeNames.Application.Octet)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public ActionResult<FileStreamResult> GetGeneralImage([FromRoute, Required] string? name, [FromRoute, Required] string? type)
|
||||
public ActionResult GetGeneralImage([FromRoute, Required] string? name, [FromRoute, Required] string? type)
|
||||
{
|
||||
var filename = string.Equals(type, "primary", StringComparison.OrdinalIgnoreCase)
|
||||
? "folder"
|
||||
@@ -110,7 +110,7 @@ namespace Jellyfin.Api.Controllers
|
||||
[Produces(MediaTypeNames.Application.Octet)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public ActionResult<FileStreamResult> GetRatingImage(
|
||||
public ActionResult GetRatingImage(
|
||||
[FromRoute, Required] string? theme,
|
||||
[FromRoute, Required] string? name)
|
||||
{
|
||||
@@ -143,7 +143,7 @@ namespace Jellyfin.Api.Controllers
|
||||
[Produces(MediaTypeNames.Application.Octet)]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
public ActionResult<FileStreamResult> GetMediaInfoImage(
|
||||
public ActionResult GetMediaInfoImage(
|
||||
[FromRoute, Required] string? theme,
|
||||
[FromRoute, Required] string? name)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ namespace Jellyfin.Api.Controllers
|
||||
/// <param name="theme">Theme to search.</param>
|
||||
/// <param name="name">File name to search for.</param>
|
||||
/// <returns>A <see cref="FileStreamResult"/> containing the image contents on success, or a <see cref="NotFoundResult"/> if the image could not be found.</returns>
|
||||
private ActionResult<FileStreamResult> GetImageFile(string basePath, string? theme, string? name)
|
||||
private ActionResult GetImageFile(string basePath, string? theme, string? name)
|
||||
{
|
||||
var themeFolder = Path.Combine(basePath, theme);
|
||||
if (Directory.Exists(themeFolder))
|
||||
@@ -168,7 +168,7 @@ namespace Jellyfin.Api.Controllers
|
||||
if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
|
||||
{
|
||||
var contentType = MimeTypes.GetMimeType(path);
|
||||
return File(System.IO.File.OpenRead(path), contentType);
|
||||
return PhysicalFile(path, contentType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Jellyfin.Api.Controllers
|
||||
if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
|
||||
{
|
||||
var contentType = MimeTypes.GetMimeType(path);
|
||||
return File(System.IO.File.OpenRead(path), contentType);
|
||||
return PhysicalFile(path, contentType);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user