From b5f5c004adbcc41b09098dfefcd830816c33db2e Mon Sep 17 00:00:00 2001 From: Kilian von Pflugk Date: Mon, 13 May 2024 23:50:51 +0200 Subject: [PATCH] use MediaBrowser.Common.Api --- .../Controllers/SkipIntroController.cs | 5 +++-- .../Controllers/TroubleshootingController.cs | 3 ++- .../Controllers/VisualizationController.cs | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs index 9742333..f6125a5 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/SkipIntroController.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Net.Mime; using ConfusedPolarBear.Plugin.IntroSkipper.Configuration; +using MediaBrowser.Common.Api; using MediaBrowser.Controller.Entities.TV; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -115,7 +116,7 @@ public class SkipIntroController : ControllerBase /// Mode. /// Operation successful. /// No content. - [Authorize(Policy = "RequiresElevation")] + [Authorize(Policy = Policies.RequiresElevation)] [HttpPost("Intros/EraseTimestamps")] public ActionResult ResetIntroTimestamps([FromQuery] AnalysisMode mode) { @@ -138,7 +139,7 @@ public class SkipIntroController : ControllerBase /// Mode. /// All timestamps have been returned. /// List of IntroWithMetadata objects. - [Authorize(Policy = "RequiresElevation")] + [Authorize(Policy = Policies.RequiresElevation)] [HttpGet("Intros/All")] public ActionResult> GetAllTimestamps( [FromQuery] AnalysisMode mode = AnalysisMode.Introduction) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/TroubleshootingController.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/TroubleshootingController.cs index 630a65f..c64ae6f 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/TroubleshootingController.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/TroubleshootingController.cs @@ -2,6 +2,7 @@ using System; using System.Net.Mime; using System.Text; using MediaBrowser.Common; +using MediaBrowser.Common.Api; using MediaBrowser.Common.Configuration; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -12,7 +13,7 @@ namespace ConfusedPolarBear.Plugin.IntroSkipper.Controllers; /// /// Troubleshooting controller. /// -[Authorize(Policy = "RequiresElevation")] +[Authorize(Policy = Policies.RequiresElevation)] [ApiController] [Produces(MediaTypeNames.Application.Json)] [Route("IntroSkipper")] diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/VisualizationController.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/VisualizationController.cs index 016c853..9cb1266 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/VisualizationController.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Controllers/VisualizationController.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Globalization; using System.Net.Mime; +using MediaBrowser.Common.Api; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -11,7 +12,7 @@ namespace ConfusedPolarBear.Plugin.IntroSkipper.Controllers; /// /// Audio fingerprint visualization controller. Allows browsing fingerprints on a per episode basis. /// -[Authorize(Policy = "RequiresElevation")] +[Authorize(Policy = Policies.RequiresElevation)] [ApiController] [Produces(MediaTypeNames.Application.Json)] [Route("Intros")]