From cd99a876c979d7772b38eca3beddf1c1cb2efc59 Mon Sep 17 00:00:00 2001 From: tidusjar Date: Sat, 30 Jan 2021 23:22:40 +0000 Subject: [PATCH] Moved the videos into a carousel and outside of the accordion on the movies page --- src/Ombi/Attributes/WizardActionFilter.cs | 26 ++++++++++++++ .../movie/movie-details.component.html | 31 ++++++++-------- .../media-details.component.scss | 4 +++ .../src/styles/primeng-overrides.scss | 6 ++-- src/Ombi/Controllers/V2/WizardController.cs | 35 +++++++++++++++++++ src/Ombi/Startup.cs | 2 ++ 6 files changed, 87 insertions(+), 17 deletions(-) create mode 100644 src/Ombi/Attributes/WizardActionFilter.cs create mode 100644 src/Ombi/Controllers/V2/WizardController.cs diff --git a/src/Ombi/Attributes/WizardActionFilter.cs b/src/Ombi/Attributes/WizardActionFilter.cs new file mode 100644 index 000000000..644256d08 --- /dev/null +++ b/src/Ombi/Attributes/WizardActionFilter.cs @@ -0,0 +1,26 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.DependencyInjection; +using Ombi.Core.Settings; +using Ombi.Settings.Settings.Models; +using System.Threading.Tasks; + +namespace Ombi.Attributes +{ + public class WizardActionFilter : IAsyncActionFilter + { + public async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next) + { + var settingsService = context.HttpContext.RequestServices.GetRequiredService>(); + + var settings = await settingsService.GetSettingsAsync(); + + if (!settings.Wizard) + { + await next(); + return; + } + context.Result = new UnauthorizedResult(); + } + } +} diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html index 0aff4e4f6..f23735c46 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.html @@ -125,6 +125,23 @@ + + +
+
+ + + + + +
+
+
@@ -172,20 +189,6 @@
- - - - {{'MediaDetails.VideosTitle' | translate}} - - - -
- -
- -
-
-
diff --git a/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss b/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss index e8ed3e2e1..1923f9c09 100644 --- a/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss +++ b/src/Ombi/ClientApp/src/app/media-details/media-details.component.scss @@ -255,3 +255,7 @@ border: 1px solid #00a4dc; color: #00a4dc; } + +::ng-deep .p-carousel-indicators { + display: none !important; + } diff --git a/src/Ombi/ClientApp/src/styles/primeng-overrides.scss b/src/Ombi/ClientApp/src/styles/primeng-overrides.scss index 4ccb0765e..e8c023644 100644 --- a/src/Ombi/ClientApp/src/styles/primeng-overrides.scss +++ b/src/Ombi/ClientApp/src/styles/primeng-overrides.scss @@ -9,10 +9,10 @@ .ui-carousel-viewport { border:0 !important; - background-color:transparent !important; + background-color:transparent !important; } .ui-carousel .ui-carousel-header { background-color:transparent !important; - border: 0 !important; -} \ No newline at end of file + border: 0 !important; +} diff --git a/src/Ombi/Controllers/V2/WizardController.cs b/src/Ombi/Controllers/V2/WizardController.cs new file mode 100644 index 000000000..e7fa82fec --- /dev/null +++ b/src/Ombi/Controllers/V2/WizardController.cs @@ -0,0 +1,35 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.Extensions.DependencyInjection; +using Ombi.Attributes; +using Ombi.Core.Settings; +using Ombi.Settings.Settings.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Ombi.Controllers.V2 +{ + [ServiceFilter(typeof(WizardActionFilter))] + [AllowAnonymous] + public class WizardController : V2Controller + { + + private ISettingsService _ombiSettings { get; } + + + [HttpGet] + public IActionResult Ok() + { + return Ok(); + } + + + + + } + + +} diff --git a/src/Ombi/Startup.cs b/src/Ombi/Startup.cs index fecaaccb3..56e28ce14 100644 --- a/src/Ombi/Startup.cs +++ b/src/Ombi/Startup.cs @@ -30,6 +30,7 @@ using Newtonsoft.Json; using ILogger = Serilog.ILogger; using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Ombi.HealthChecks; +using Ombi.Attributes; namespace Ombi { @@ -97,6 +98,7 @@ namespace Ombi services.RegisterApplicationDependencies(); // Ioc and EF services.AddSwagger(); services.AddAppSettingsValues(Configuration); + services.AddScoped(); services.AddCors(o => o.AddPolicy("MyPolicy", builder => {