Managed to figure out how to use javascript on the plugin page by utilizing data-controller as found in other repos. Unsure how this is used, but appears to be how you can attach a js file to a div. Also implemented a basic state api to build off of in future.
This commit is contained in:
22
Jellyfin.Plugin.MediaCleaner/Controllers/StateController.cs
Normal file
22
Jellyfin.Plugin.MediaCleaner/Controllers/StateController.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Jellyfin.Plugin.MediaCleaner.Data;
|
||||
using Jellyfin.Plugin.MediaCleaner.Models;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Jellyfin.Plugin.MediaCleaner.Controllers;
|
||||
|
||||
[Route("mediacleaner/state")]
|
||||
public class StateController : Controller
|
||||
{
|
||||
private readonly PluginState _state;
|
||||
public StateController(PluginState state) => _state = state;
|
||||
|
||||
[HttpGet]
|
||||
public IActionResult Get() => Ok(_state.GetSeriesInfo());
|
||||
|
||||
[HttpPost("add")]
|
||||
public IActionResult AddSeriesInfo([FromBody] SeriesInfo seriesInfo)
|
||||
{
|
||||
_state.AddSeriesInfo(seriesInfo);
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user