using Jellyfin.Plugin.MediaCleaner.Data; using Jellyfin.Plugin.MediaCleaner; using Jellyfin.Plugin.MediaCleaner.Models; using Microsoft.AspNetCore.Mvc; using Jellyfin.Plugin.MediaCleaner.Configuration; namespace Jellyfin.Plugin.MediaCleaner.Controllers; [Route("mediacleaner/state")] public class StateController(MediaCleanerState state) : Controller { private readonly MediaCleanerState _state = state; private static PluginConfiguration Configuration => Plugin.Instance!.Configuration; [HttpGet("getSeriesInfo")] public IActionResult GetSeriesInfo() => Ok(_state.GetSeriesInfo()); [HttpGet("getMovieInfo")] public IActionResult GetMovieInfo() => Ok(_state.GetMovieInfo()); [HttpGet("updateState")] public IActionResult GetUpdateState() => Ok(_state.UpdateState()); [HttpGet("getMoviesTitle")] public IActionResult GetMoviesTitle() => Ok($"Stale Movies (Unwatched for and created over {Configuration.StaleMediaCutoff} Days ago.)"); [HttpGet("getSeriesTitle")] public IActionResult GetSeriesTitle() => Ok($"Stale Series (Unwatched for and created over {Configuration.StaleMediaCutoff} Days ago.)"); }