mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 08:15:28 +03:00
User proper File constructor
This commit is contained in:
@@ -15,7 +15,7 @@ using Microsoft.AspNetCore.Authorization;
|
|||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace Jellyfin.Api.Controllers.Images
|
namespace Jellyfin.Api.Controllers
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Images By Name Controller.
|
/// Images By Name Controller.
|
||||||
@@ -81,7 +81,7 @@ namespace Jellyfin.Api.Controllers.Images
|
|||||||
}
|
}
|
||||||
|
|
||||||
var contentType = MimeTypes.GetMimeType(path);
|
var contentType = MimeTypes.GetMimeType(path);
|
||||||
return new FileStreamResult(System.IO.File.OpenRead(path), contentType);
|
return File(System.IO.File.OpenRead(path), contentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -168,7 +168,7 @@ namespace Jellyfin.Api.Controllers.Images
|
|||||||
if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
|
if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
|
||||||
{
|
{
|
||||||
var contentType = MimeTypes.GetMimeType(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))
|
if (!string.IsNullOrEmpty(path) && System.IO.File.Exists(path))
|
||||||
{
|
{
|
||||||
var contentType = MimeTypes.GetMimeType(path);
|
var contentType = MimeTypes.GetMimeType(path);
|
||||||
return new FileStreamResult(System.IO.File.OpenRead(path), contentType);
|
return File(System.IO.File.OpenRead(path), contentType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user