diff options
| author | crobibero <cody@robibe.ro> | 2020-06-17 10:49:34 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-06-17 10:49:34 -0600 |
| commit | 0d1298e851d3cdfc56b74f44dc94cfc981a4e8f3 (patch) | |
| tree | 57d7a4f9c7194a07d0ed14ed72885ca4210a1f7b | |
| parent | bd0975397613cc87bb97ae20a0608257487d0f77 (diff) | |
User proper File constructor
| -rw-r--r-- | Jellyfin.Api/Controllers/ImageByNameController.cs (renamed from Jellyfin.Api/Controllers/Images/ImageByNameController.cs) | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Jellyfin.Api/Controllers/Images/ImageByNameController.cs b/Jellyfin.Api/Controllers/ImageByNameController.cs index db475d6b4..fa46b6dd1 100644 --- a/Jellyfin.Api/Controllers/Images/ImageByNameController.cs +++ b/Jellyfin.Api/Controllers/ImageByNameController.cs @@ -15,7 +15,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -namespace Jellyfin.Api.Controllers.Images +namespace Jellyfin.Api.Controllers { /// <summary> /// Images By Name Controller. @@ -81,7 +81,7 @@ namespace Jellyfin.Api.Controllers.Images } var contentType = MimeTypes.GetMimeType(path); - return new FileStreamResult(System.IO.File.OpenRead(path), contentType); + return File(System.IO.File.OpenRead(path), contentType); } /// <summary> @@ -168,7 +168,7 @@ namespace Jellyfin.Api.Controllers.Images if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path)) { var contentType = MimeTypes.GetMimeType(path); - return new FileStreamResult(System.IO.File.OpenRead(path), contentType); + return File(System.IO.File.OpenRead(path), contentType); } } @@ -181,7 +181,7 @@ namespace Jellyfin.Api.Controllers.Images if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path)) { var contentType = MimeTypes.GetMimeType(path); - return new FileStreamResult(System.IO.File.OpenRead(path), contentType); + return File(System.IO.File.OpenRead(path), contentType); } } |
