aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Controllers/ImageByNameController.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-09-02 15:06:13 -0600
committercrobibero <cody@robibe.ro>2020-09-02 15:06:13 -0600
commit932c4d25a40148a8fe0994c81937907ed9496195 (patch)
tree56270cd4d9350278cfe00c74f04ff3679643e972 /Jellyfin.Api/Controllers/ImageByNameController.cs
parenta698dab66fb8cb17ca12f03c4a271cbe15b7fac1 (diff)
Clean api return types
Diffstat (limited to 'Jellyfin.Api/Controllers/ImageByNameController.cs')
-rw-r--r--Jellyfin.Api/Controllers/ImageByNameController.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Jellyfin.Api/Controllers/ImageByNameController.cs b/Jellyfin.Api/Controllers/ImageByNameController.cs
index 528590536..2954e3ec7 100644
--- a/Jellyfin.Api/Controllers/ImageByNameController.cs
+++ b/Jellyfin.Api/Controllers/ImageByNameController.cs
@@ -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);
}
}