Files
jellyfin-plugin-mediacleaner/Jellyfin.Plugin.MediaCleaner/Controllers/StateController.cs

32 lines
1.1 KiB
C#

using Jellyfin.Plugin.MediaCleaner.Data;
using Jellyfin.Plugin.MediaCleaner;
using Jellyfin.Plugin.MediaCleaner.Models;
using Microsoft.AspNetCore.Mvc;
namespace Jellyfin.Plugin.MediaCleaner.Controllers;
[Route("mediacleaner/state")]
public class StateController(MediaCleanerState state) : Controller
{
private readonly MediaCleanerState _state = state;
private static Configuration 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.)");
}