diff options
| author | crobibero <cody@robibe.ro> | 2020-09-09 14:23:53 -0600 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-09-09 14:23:53 -0600 |
| commit | efce4d4bf3667dbf4e130118e26f5c5c0775ca21 (patch) | |
| tree | b8eb0131c700b5a07458135a46c0453f8d767107 /Jellyfin.Api/Controllers/RemoteImageController.cs | |
| parent | 8e15142d82b8f279e7efeb873491fff7f60a881f (diff) | |
| parent | 621f3b705052f628e27fb975a8bb809853742ad8 (diff) | |
Merge remote-tracking branch 'upstream/master' into bad-route
Diffstat (limited to 'Jellyfin.Api/Controllers/RemoteImageController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/RemoteImageController.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/RemoteImageController.cs b/Jellyfin.Api/Controllers/RemoteImageController.cs index bdc817126..5f095443b 100644 --- a/Jellyfin.Api/Controllers/RemoteImageController.cs +++ b/Jellyfin.Api/Controllers/RemoteImageController.cs @@ -7,6 +7,7 @@ using System.Net.Http; using System.Net.Mime; using System.Threading; using System.Threading.Tasks; +using Jellyfin.Api.Attributes; using Jellyfin.Api.Constants; using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Net; @@ -155,6 +156,7 @@ namespace Jellyfin.Api.Controllers [Produces(MediaTypeNames.Application.Octet)] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] + [ProducesImageFile] public async Task<ActionResult> GetRemoteImage([FromQuery, Required] string imageUrl) { var urlHash = imageUrl.GetMD5(); @@ -192,7 +194,7 @@ namespace Jellyfin.Api.Controllers } var contentType = MimeTypes.GetMimeType(contentPath); - return File(System.IO.File.OpenRead(contentPath), contentType); + return PhysicalFile(contentPath, contentType); } /// <summary> |
