Moved the videos into a carousel and outside of the accordion on the movies page

pull/4019/head
tidusjar 4 years ago
parent e28f3b876b
commit cd99a876c9

@ -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<ISettingsService<OmbiSettings>>();
var settings = await settingsService.GetSettingsAsync();
if (!settings.Wizard)
{
await next();
return;
}
context.Result = new UnauthorizedResult();
}
}
}

@ -125,6 +125,23 @@
</div> </div>
</div> </div>
<!-- <div class="row card-spacer" *ngIf="movie.videos?.results?.length > 0">
<div class="col-md-6" *ngFor="let video of movie.videos?.results">
<iframe width="100%" height="315px" [src]="'https://www.youtube.com/embed/' + video.key | safe" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div> -->
<div class="row" *ngIf="movie.videos?.results?.length > 0">
<div class="col-12">
<p-carousel class="no-indicator" [numVisible]="10" [numScroll]="10" [page]="0" [value]="movie.videos?.results">
<ng-template let-result pTemplate="item">
<iframe width="98%" height="100%" [src]="'https://www.youtube.com/embed/' + result.key | safe" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</ng-template>
</p-carousel>
</div>
</div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="issuesPanel"> <div class="issuesPanel">
@ -172,20 +189,6 @@
</div> </div>
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
<mat-expansion-panel>
<mat-expansion-panel-header>
<mat-panel-title>
{{'MediaDetails.VideosTitle' | translate}}
</mat-panel-title>
</mat-expansion-panel-header>
<div class="row card-spacer" *ngIf="movie.videos?.results?.length > 0">
<div class="col-md-6" *ngFor="let video of movie.videos?.results">
<iframe width="100%" height="315px" [src]="'https://www.youtube.com/embed/' + video.key | safe" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
</mat-expansion-panel>
</mat-accordion> </mat-accordion>
</div> </div>
</div> </div>

@ -255,3 +255,7 @@
border: 1px solid #00a4dc; border: 1px solid #00a4dc;
color: #00a4dc; color: #00a4dc;
} }
::ng-deep .p-carousel-indicators {
display: none !important;
}

@ -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> _ombiSettings { get; }
[HttpGet]
public IActionResult Ok()
{
return Ok();
}
}
}

@ -30,6 +30,7 @@ using Newtonsoft.Json;
using ILogger = Serilog.ILogger; using ILogger = Serilog.ILogger;
using Microsoft.AspNetCore.Diagnostics.HealthChecks; using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Ombi.HealthChecks; using Ombi.HealthChecks;
using Ombi.Attributes;
namespace Ombi namespace Ombi
{ {
@ -97,6 +98,7 @@ namespace Ombi
services.RegisterApplicationDependencies(); // Ioc and EF services.RegisterApplicationDependencies(); // Ioc and EF
services.AddSwagger(); services.AddSwagger();
services.AddAppSettingsValues(Configuration); services.AddAppSettingsValues(Configuration);
services.AddScoped<WizardActionFilter>();
services.AddCors(o => o.AddPolicy("MyPolicy", builder => services.AddCors(o => o.AddPolicy("MyPolicy", builder =>
{ {

Loading…
Cancel
Save