diff --git a/Jellyfin.Api/Controllers/PackageController.cs b/Jellyfin.Api/Controllers/PackageController.cs
index ab4d20458..1da5ac0e9 100644
--- a/Jellyfin.Api/Controllers/PackageController.cs
+++ b/Jellyfin.Api/Controllers/PackageController.cs
@@ -39,11 +39,11 @@ namespace Jellyfin.Api.Controllers
/// Package info.
[HttpGet("/{Name}")]
[ProducesResponseType(typeof(PackageInfo), StatusCodes.Status200OK)]
- public ActionResult GetPackageInfo(
+ public async Task> GetPackageInfo(
[FromRoute] [Required] string name,
[FromQuery] string? assemblyGuid)
{
- var packages = _installationManager.GetAvailablePackages().GetAwaiter().GetResult();
+ var packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false);
var result = _installationManager.FilterPackages(
packages,
name,
@@ -58,11 +58,11 @@ namespace Jellyfin.Api.Controllers
/// Packages information.
[HttpGet]
[ProducesResponseType(typeof(PackageInfo[]), StatusCodes.Status200OK)]
- public async Task> GetPackages()
+ public async Task> GetPackages()
{
IEnumerable packages = await _installationManager.GetAvailablePackages().ConfigureAwait(false);
- return Ok(packages.ToArray());
+ return packages;
}
///
@@ -75,6 +75,7 @@ namespace Jellyfin.Api.Controllers
[HttpPost("/Installed/{Name}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status404NotFound)]
+ [Authorize(Policy = Policies.RequiresElevation)]
public async Task InstallPackage(
[FromRoute] [Required] string name,
[FromQuery] string assemblyGuid,