User proper File constructor
This commit is contained in:
parent
bd09753976
commit
0d1298e851
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user