mirror of https://github.com/jellyfin/jellyfin.git
Set openapi schema type to file where possible
This commit is contained in:
parent
c98952937e
commit
c473645f9d
|
@ -7,6 +7,7 @@ using System.Net.Http;
|
||||||
using System.Net.Mime;
|
using System.Net.Mime;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Jellyfin.Api.Attributes;
|
||||||
using Jellyfin.Api.Constants;
|
using Jellyfin.Api.Constants;
|
||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Common.Extensions;
|
||||||
using MediaBrowser.Controller;
|
using MediaBrowser.Controller;
|
||||||
|
@ -154,6 +155,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
[Produces(MediaTypeNames.Application.Octet)]
|
[Produces(MediaTypeNames.Application.Octet)]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
[ProducesImageFile]
|
||||||
public async Task<ActionResult> GetRemoteImage([FromQuery, Required] string imageUrl)
|
public async Task<ActionResult> GetRemoteImage([FromQuery, Required] string imageUrl)
|
||||||
{
|
{
|
||||||
var urlHash = imageUrl.GetMD5();
|
var urlHash = imageUrl.GetMD5();
|
||||||
|
@ -191,7 +193,7 @@ namespace Jellyfin.Api.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
var contentType = MimeTypes.GetMimeType(contentPath);
|
var contentType = MimeTypes.GetMimeType(contentPath);
|
||||||
return File(System.IO.File.OpenRead(contentPath), contentType);
|
return PhysicalFile(contentPath, contentType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue