mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-16 02:18:54 -07:00
Apply suggestions from code review
Co-Authored-By: Cody Robibero <cody@robibe.ro>
This commit is contained in:
parent
f66714561e
commit
5aced0ea0f
@ -39,11 +39,11 @@ namespace Jellyfin.Api.Controllers
|
|||||||
/// <returns>Package info.</returns>
|
/// <returns>Package info.</returns>
|
||||||
[HttpGet("/{Name}")]
|
[HttpGet("/{Name}")]
|
||||||
[ProducesResponseType(typeof(PackageInfo), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(PackageInfo), StatusCodes.Status200OK)]
|
||||||
public ActionResult<PackageInfo> GetPackageInfo(
|
public async Task<ActionResult<PackageInfo>> GetPackageInfo(
|
||||||
[FromRoute] [Required] string name,
|
[FromRoute] [Required] string name,
|
||||||
[FromQuery] string? assemblyGuid)
|
[FromQuery] string? assemblyGuid)
|
||||||
{
|
{
|
||||||
var packages = _installationManager.GetAvailablePackages().GetAwaiter().GetResult();
|
var packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false);
|
||||||
var result = _installationManager.FilterPackages(
|
var result = _installationManager.FilterPackages(
|
||||||
packages,
|
packages,
|
||||||
name,
|
name,
|
||||||
@ -58,11 +58,11 @@ namespace Jellyfin.Api.Controllers
|
|||||||
/// <returns>Packages information.</returns>
|
/// <returns>Packages information.</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(typeof(PackageInfo[]), StatusCodes.Status200OK)]
|
[ProducesResponseType(typeof(PackageInfo[]), StatusCodes.Status200OK)]
|
||||||
public async Task<ActionResult<PackageInfo[]>> GetPackages()
|
public async Task<IEnumerable<PackageInfo>> GetPackages()
|
||||||
{
|
{
|
||||||
IEnumerable<PackageInfo> packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false);
|
IEnumerable<PackageInfo> packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false);
|
||||||
|
|
||||||
return Ok(packages.ToArray());
|
return packages;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -75,6 +75,7 @@ namespace Jellyfin.Api.Controllers
|
|||||||
[HttpPost("/Installed/{Name}")]
|
[HttpPost("/Installed/{Name}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
[Authorize(Policy = Policies.RequiresElevation)]
|
||||||
public async Task<ActionResult> InstallPackage(
|
public async Task<ActionResult> InstallPackage(
|
||||||
[FromRoute] [Required] string name,
|
[FromRoute] [Required] string name,
|
||||||
[FromQuery] string assemblyGuid,
|
[FromQuery] string assemblyGuid,
|
||||||
|
Loading…
Reference in New Issue
Block a user