Removed asset controllers. Started adding design section in settings

This commit is contained in:
2025-01-07 00:08:19 +01:00
parent 8372cfad1b
commit e299cde6da
10 changed files with 43 additions and 72 deletions

View File

@@ -1,26 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Moonlight.ApiServer.Services;
using Moonlight.Shared.Http.Responses.Assets;
namespace Moonlight.ApiServer.Http.Controllers.Assets;
[ApiController]
[Route("api/assets")]
public class AssetsController : Controller
{
private readonly AssetService AssetService;
public AssetsController(AssetService assetService)
{
AssetService = assetService;
}
[HttpGet]
public async Task<FrontendAssetResponse> Get()
{
return new FrontendAssetResponse()
{
JavascriptFiles = AssetService.GetJavascriptAssets(),
};
}
}

View File

@@ -1,37 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using MoonCore.Exceptions;
using MoonCore.Models;
using Moonlight.ApiServer.Services;
namespace Moonlight.ApiServer.Http.Controllers.Assets;
[ApiController]
[Route("api/assets/plugins")]
public class AssetsPluginsController : Controller
{
private readonly PluginService PluginService;
public AssetsPluginsController(PluginService pluginService)
{
PluginService = pluginService;
}
[HttpGet]
public Task<HostedPluginsManifest> GetManifest()
{
return Task.FromResult(PluginService.HostedPluginsManifest);
}
[HttpGet("stream")]
public async Task GetAssembly([FromQuery(Name = "assembly")] string assembly)
{
var assembliesMap = PluginService.ClientAssemblyMap;
if (assembliesMap.ContainsKey(assembly))
throw new HttpApiException("The requested assembly could not be found", 404);
var path = assembliesMap[assembly];
await Results.File(path).ExecuteAsync(HttpContext);
}
}

View File

@@ -42,7 +42,7 @@ public class FrontendController : Controller
return configuration;
}
[HttpGet("plugins/{assemblyName}")]
[HttpGet("plugins/{assemblyName}")] // TODO: Test this
public async Task GetPluginAssembly(string assemblyName)
{
var assembliesMap = PluginService.ClientAssemblyMap;