aboutsummaryrefslogtreecommitdiff
path: root/Jellyfin.Api/Attributes/DlnaEnabledAttribute.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Jellyfin.Api/Attributes/DlnaEnabledAttribute.cs')
-rw-r--r--Jellyfin.Api/Attributes/DlnaEnabledAttribute.cs25
1 files changed, 0 insertions, 25 deletions
diff --git a/Jellyfin.Api/Attributes/DlnaEnabledAttribute.cs b/Jellyfin.Api/Attributes/DlnaEnabledAttribute.cs
deleted file mode 100644
index d3a6ac9c8..000000000
--- a/Jellyfin.Api/Attributes/DlnaEnabledAttribute.cs
+++ /dev/null
@@ -1,25 +0,0 @@
-using Emby.Dlna;
-using MediaBrowser.Controller.Configuration;
-using Microsoft.AspNetCore.Http;
-using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.Filters;
-using Microsoft.Extensions.DependencyInjection;
-
-namespace Jellyfin.Api.Attributes;
-
-/// <inheritdoc />
-public sealed class DlnaEnabledAttribute : ActionFilterAttribute
-{
- /// <inheritdoc />
- public override void OnActionExecuting(ActionExecutingContext context)
- {
- var serverConfigurationManager = context.HttpContext.RequestServices.GetRequiredService<IServerConfigurationManager>();
-
- var enabled = serverConfigurationManager.GetDlnaConfiguration().EnableServer;
-
- if (!enabled)
- {
- context.Result = new StatusCodeResult(StatusCodes.Status503ServiceUnavailable);
- }
- }
-}