using Jellyfin.Plugin.JRay.Models;
using Jellyfin.Plugin.JRay.Services;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
namespace Jellyfin.Plugin.JRay.Controllers;
///
/// Reports whether JRay's hard dependency on the File Transformation plugin is
/// satisfied, for the configuration page to surface.
///
///
/// Absent that plugin the pause overlay is disabled and every other JRay feature
/// continues to work — so this is a status to display, not an error to raise.
///
[ApiController]
[Route("Plugins/JRay/Status")]
[Authorize(Roles = "Administrator")]
// TRACES: JR-023 | PR-004
public class StatusController : ControllerBase
{
///
/// Gets the dependency status.
///
/// The dependency status.
[HttpGet("Dependencies")]
[ProducesResponseType(StatusCodes.Status200OK)]
public ActionResult GetDependencies()
{
return Ok(new DependencyStatus
{
FileTransformationAvailable = Plugin.FileTransformationAvailable,
OverlayEnabled = Plugin.OverlayEnabled,
FileTransformationManifestUrl = FileTransformationRegistration.ManifestUrl,
});
}
}