User proper File constructor

This commit is contained in:
crobibero 2020-06-17 10:49:34 -06:00
parent bd09753976
commit 0d1298e851

View file

@ -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);
}
}