You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
669 B
23 lines
669 B
using Microsoft.AspNetCore.Mvc;
|
|
using Microsoft.AspNetCore.Mvc.Filters;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using NzbDrone.Core.Configuration;
|
|
|
|
namespace Radarr.Http.REST.Filters;
|
|
|
|
public class LogDatabaseDisabledActionFilterAttribute : ActionFilterAttribute
|
|
{
|
|
public override void OnActionExecuting(ActionExecutingContext context)
|
|
{
|
|
var configFileProvider = context.HttpContext.RequestServices.GetService<IConfigFileProvider>();
|
|
if (!configFileProvider.LogDbEnabled)
|
|
{
|
|
context.Result = new NotFoundResult();
|
|
}
|
|
}
|
|
|
|
public override void OnActionExecuted(ActionExecutedContext context)
|
|
{
|
|
}
|
|
}
|