Merges with develop.

This commit is contained in:
Victor Usoltsev 2021-03-29 08:50:05 +13:00
commit 4d9500df54
8 changed files with 116 additions and 74 deletions

View file

@ -167,7 +167,7 @@ namespace Ombi.Core.Senders
{ {
// Get the root path from the rootfolder selected. // Get the root path from the rootfolder selected.
// For some reason, if we haven't got one use the first root folder in Sonarr // For some reason, if we haven't got one use the first root folder in Sonarr
rootFolderPath = await GetSonarrRootPath(model.ParentRequest.RootFolder ?? int.Parse(s.RootPathAnime), s); rootFolderPath = await GetSonarrRootPath(int.Parse(s.RootPathAnime), s);
int.TryParse(s.QualityProfileAnime, out qualityToUse); int.TryParse(s.QualityProfileAnime, out qualityToUse);
if (profiles != null) if (profiles != null)
{ {
@ -188,7 +188,7 @@ namespace Ombi.Core.Senders
int.TryParse(s.QualityProfile, out qualityToUse); int.TryParse(s.QualityProfile, out qualityToUse);
// Get the root path from the rootfolder selected. // Get the root path from the rootfolder selected.
// For some reason, if we haven't got one use the first root folder in Sonarr // For some reason, if we haven't got one use the first root folder in Sonarr
rootFolderPath = await GetSonarrRootPath(model.ParentRequest.RootFolder ?? int.Parse(s.RootPath), s); rootFolderPath = await GetSonarrRootPath(int.Parse(s.RootPath), s);
if (profiles != null) if (profiles != null)
{ {
if (profiles.SonarrRootPath > 0) if (profiles.SonarrRootPath > 0)
@ -206,11 +206,19 @@ namespace Ombi.Core.Senders
// Overrides on the request take priority // Overrides on the request take priority
if (model.ParentRequest.QualityOverride.HasValue) if (model.ParentRequest.QualityOverride.HasValue)
{ {
qualityToUse = model.ParentRequest.QualityOverride.Value; var qualityOverride = model.ParentRequest.QualityOverride.Value;
if (qualityOverride > 0)
{
qualityToUse = qualityOverride;
}
} }
if (model.ParentRequest.RootFolder.HasValue) if (model.ParentRequest.RootFolder.HasValue)
{ {
rootFolderPath = await GetSonarrRootPath(model.ParentRequest.RootFolder.Value, s); var rootfolderOverride = model.ParentRequest.RootFolder.Value;
if (rootfolderOverride > 0)
{
rootFolderPath = await GetSonarrRootPath(rootfolderOverride, s);
}
} }
// Are we using v3 sonarr? // Are we using v3 sonarr?
@ -547,4 +555,4 @@ namespace Ombi.Core.Senders
return string.Empty; return string.Empty;
} }
} }
} }

View file

@ -39,12 +39,7 @@ namespace Ombi.Notifications
Year = req?.ReleaseDate.Year.ToString(); Year = req?.ReleaseDate.Year.ToString();
Overview = req?.Overview; Overview = req?.Overview;
AdditionalInformation = opts?.AdditionalInformation ?? string.Empty; AdditionalInformation = opts?.AdditionalInformation ?? string.Empty;
PosterImage = $"https://image.tmdb.org/t/p/w300/{req?.PosterPath?.TrimStart('/') ?? string.Empty}";
if (!string.IsNullOrEmpty(req?.PosterPath))
{
PosterImage = $"https://image.tmdb.org/t/p/w300/{req.PosterPath.TrimStart('/')}";
}
CalculateRequestStatus(req); CalculateRequestStatus(req);
} }
@ -58,11 +53,8 @@ namespace Ombi.Notifications
Year = req?.ParentRequest?.ReleaseDate.Year.ToString(); Year = req?.ParentRequest?.ReleaseDate.Year.ToString();
Overview = req?.ParentRequest?.Overview; Overview = req?.ParentRequest?.Overview;
AdditionalInformation = opts.AdditionalInformation; AdditionalInformation = opts.AdditionalInformation;
PosterImage =
if (!string.IsNullOrEmpty(req?.ParentRequest?.PosterPath)) $"https://image.tmdb.org/t/p/w300/{req?.ParentRequest?.PosterPath?.TrimStart('/') ?? string.Empty}";
{
PosterImage = $"https://image.tmdb.org/t/p/w300/{req.ParentRequest?.PosterPath.TrimStart('/')}";
}
// Generate episode list. // Generate episode list.
StringBuilder epSb = new StringBuilder(); StringBuilder epSb = new StringBuilder();

View file

@ -1,21 +1,32 @@
<!-- 
you can substitue the span of reauth email for a input with the email and <div *ngIf="background" @fadeInOut class="bg" [style.background-image]="background">
include the remember me checkbox <div class="login-gradient-bar">
--> </div>
<div *ngIf="form && customizationSettings && background"> </div>
<div class="bg" [style.background-image]="background"></div> <div class="small-middle-container">
<div class="container" id="login"> <div *ngIf="form && customizationSettings">
<div class="card card-container">
<!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> --> <mat-card class="mat-elevation-z8 top-margin login-card">
<div *ngIf="!customizationSettings.logo"><img id="profile-img" class="profile-img-card" src="{{baseUrl}}/images/logo.png" /></div> <H1 *ngIf="!customizationSettings.logo && !customizationSettings.applicationName" class="login_logo">OMBI</H1>
<div *ngIf="customizationSettings.logo"><img id="profile-img" class="center" [src]="customizationSettings.logo" /></div> <H1 *ngIf="customizationSettings.applicationName && !customizationSettings.logo" [ngClass]="{'bigText': customizationSettings.applicationName.length >= 7 && customizationSettings.applicationName.length < 14, 'hugeText': customizationSettings.applicationName.length >= 14 }" class="login_logo custom">{{customizationSettings.applicationName}}</H1>
<p id="profile-name" class="profile-name-card"></p> <img mat-card-image *ngIf="customizationSettings.logo" [src]="customizationSettings.logo">
<mat-card-content id="login-box">
<form class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
<form class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)"> <mat-form-field class="dark full-width" appearance="outline">
<input type="email" id="inputEmail" class="form-control" formControlName="email" [attr.placeholder]="'PasswordReset.EmailAddressPlaceholder' | translate" autofocus> <mat-label>{{'PasswordReset.EmailAddressPlaceholder' | translate}}</mat-label>
<button class="btn btn-success-outline" [disabled]="form.invalid" type="submit" [translate]="'PasswordReset.ResetPasswordButton'"></button> <input type="email" id="username-field" matInput formControlName="email" autofocus/>
<mat-error id="username-error" *ngIf="form.get('email').hasError('required')">
</form><!-- /form --> {{'PasswordReset.EmailAddressPlaceholder' | translate}} is <strong>required</strong></mat-error>
</div><!-- /card-container --> </mat-form-field>
</div><!-- /container --> <button id="reset" mat-raised-button color="accent" type="submit">{{'PasswordReset.ResetPasswordButton' | translate}}</button>
</div>
</form>
</mat-card-content>
</mat-card>
</div>
</div>

View file

@ -2,12 +2,14 @@
import { Component, OnInit, Inject } from "@angular/core"; import { Component, OnInit, Inject } from "@angular/core";
import { FormBuilder, FormGroup, Validators } from "@angular/forms"; import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { DomSanitizer } from "@angular/platform-browser"; import { DomSanitizer } from "@angular/platform-browser";
import { fadeInOutAnimation } from "../animations/fadeinout";
import { ICustomizationSettings } from "../interfaces"; import { ICustomizationSettings } from "../interfaces";
import { IdentityService, ImageService, NotificationService, SettingsService } from "../services"; import { IdentityService, ImageService, NotificationService, SettingsService } from "../services";
@Component({ @Component({
templateUrl: "./resetpassword.component.html", templateUrl: "./resetpassword.component.html",
animations: [fadeInOutAnimation],
styleUrls: ["./login.component.scss"], styleUrls: ["./login.component.scss"],
}) })
export class ResetPasswordComponent implements OnInit { export class ResetPasswordComponent implements OnInit {

View file

@ -1,30 +1,56 @@
<div *ngIf="form && customizationSettings"> 
<div class="bg" [style.background-image]="background"></div> <div *ngIf="background" @fadeInOut class="bg" [style.background-image]="background">
<div class="container" id="login"> <div class="login-gradient-bar">
<div class="card card-container"> </div>
<!-- <img class="profile-img-card" src="//lh3.googleusercontent.com/-6V8xOA6M7BA/AAAAAAAAAAI/AAAAAAAAAAA/rzlHcD0KYwo/photo.jpg?sz=120" alt="" /> --> </div>
<div *ngIf="!customizationSettings.logo"><img id="profile-img" class="profile-img-card" src="{{baseUrl}}/images/logo.png" /></div> <div class="small-middle-container">
<div *ngIf="customizationSettings.logo"><img id="profile-img" class="center" [src]="customizationSettings.logo" /></div> <div *ngIf="form && customizationSettings">
<p id="profile-name" class="profile-name-card"></p>
<mat-card class="mat-elevation-z8 top-margin login-card">
<H1 *ngIf="!customizationSettings.logo && !customizationSettings.applicationName" class="login_logo">OMBI</H1>
<div *ngIf="form.value.password !== form.value.confirmPassword" class="alert alert-danger">The passwords do not match</div> <H1 *ngIf="customizationSettings.applicationName && !customizationSettings.logo" [ngClass]="{'bigText': customizationSettings.applicationName.length >= 7 && customizationSettings.applicationName.length < 14, 'hugeText': customizationSettings.applicationName.length >= 14 }" class="login_logo custom">{{customizationSettings.applicationName}}</H1>
<div *ngIf="form.invalid && form.dirty" class="alert alert-danger"> <img mat-card-image *ngIf="customizationSettings.logo" [src]="customizationSettings.logo">
<mat-card-content id="login-box">
<div *ngIf="form.get('password').hasError('required')">The Password is required</div> <div *ngIf="form.value.password !== form.value.confirmPassword" class="alert alert-danger">The passwords do not match</div>
<div *ngIf="form.get('email').hasError('required')">The Email is required</div> <div *ngIf="form.invalid && form.dirty" class="alert alert-danger">
<div *ngIf="form.get('confirmPassword').hasError('required')">The Confirm Password is required</div>
</div> <div *ngIf="form.get('password').hasError('required')">The Password is required</div>
<div *ngIf="form.get('email').hasError('required')">The Email is required</div>
<form class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)"> <div *ngIf="form.get('confirmPassword').hasError('required')">The Confirm Password is required</div>
<input type="email" id="inputEmail" class="form-control" formControlName="email" placeholder="Email Address" autofocus> </div>
<input type="password" class="form-control" formControlName="password" placeholder="New Password">
<input type="password" class="form-control" formControlName="confirmPassword" placeholder="Confirm New Password"> <form class="form-signin" novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
<button class="btn btn-success-outline" [disabled]="form.invalid" type="submit">Reset Password</button> <mat-form-field class="dark full-width" appearance="outline">
<mat-label>{{'PasswordReset.EmailAddressPlaceholder' | translate}}</mat-label>
</form> <input type="email" id="username-field" matInput formControlName="email" autofocus/>
<mat-error id="username-error" *ngIf="form.get('email').hasError('required')">
{{'PasswordReset.EmailAddressPlaceholder' | translate}} is <strong>required</strong></mat-error>
</mat-form-field>
<mat-form-field class="dark full-width" appearance="outline">
<mat-label>New Password</mat-label>
<input type="password" id="username-field" matInput formControlName="password" autofocus/>
<mat-error id="username-error" *ngIf="form.get('password').hasError('required')">
Password is <strong>required</strong></mat-error>
</mat-form-field>
<mat-form-field class="dark full-width" appearance="outline">
<mat-label>Confirm Password</mat-label>
<input type="password" id="username-field" matInput formControlName="confirmPassword" autofocus/>
<mat-error id="username-error" *ngIf="form.get('confirmPassword').hasError('required')">
Password is <strong>required</strong></mat-error>
</mat-form-field>
<button id="reset" mat-raised-button color="accent" [disabled]="form.invalid" type="submit">{{'Reset Password' | translate}}</button>
</form>
</mat-card-content>
</mat-card>
</div> </div>
<!-- /card-container -->
</div> </div>
<!-- /container -->
</div>

View file

@ -1,6 +1,5 @@
<h1 mat-dialog-title> <h1 mat-dialog-title><i class="fas fa-sliders-h"></i> {{'MediaDetails.AdvancedOptions' | translate }}</h1>
<hr>
Advanced Options</h1>
<div mat-dialog-content> <div mat-dialog-content>
<mat-form-field appearance="outline" floatLabel=auto> <mat-form-field appearance="outline" floatLabel=auto>
<mat-label>{{'MediaDetails.QualityProfilesSelect' | translate }}</mat-label> <mat-label>{{'MediaDetails.QualityProfilesSelect' | translate }}</mat-label>
@ -18,6 +17,6 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div mat-dialog-actions> <div mat-dialog-actions>
<button mat-button [mat-dialog-close]="" cdkFocusInitial>Close</button> <button mat-button [mat-dialog-close]="" cdkFocusInitial color="warn"><i class="fas fa-times"></i> {{ 'Common.Cancel' | translate }}</button>
<button mat-button [mat-dialog-close]="data" cdkFocusInitial>Save</button> <button mat-button [mat-dialog-close]="data" cdkFocusInitial color="accent"><i class="fas fa-plus"></i> {{ 'Common.Submit' | translate }}</button>
</div> </div>

View file

@ -1,7 +1,10 @@
<h1 mat-dialog-title> <h1 mat-dialog-title><i class="fas fa-sliders-h"></i> {{'MediaDetails.AdvancedOptions' | translate }}</h1>
Advanced Options</h1>
<div mat-dialog-content> <div mat-dialog-content>
<hr />
<div class="alert alert-info" role="alert">
<i class="fas fa-x7 fa-exclamation-triangle glyphicon"></i>
<span>{{'MediaDetails.AutoApproveOptionsTvShort' | translate }}</span>
</div>
<mat-form-field> <mat-form-field>
<mat-label>{{'MediaDetails.QualityProfilesSelect' | translate }}</mat-label> <mat-label>{{'MediaDetails.QualityProfilesSelect' | translate }}</mat-label>
<mat-select [(value)]="data.profileId"> <mat-select [(value)]="data.profileId">
@ -18,6 +21,6 @@
</mat-form-field> </mat-form-field>
</div> </div>
<div mat-dialog-actions> <div mat-dialog-actions>
<button mat-raised-button [mat-dialog-close]="" color="warn">Close</button> <button mat-raised-button [mat-dialog-close]="" color="warn"><i class="fas fa-times"></i> {{ 'Common.Cancel' | translate }}</button>
<button mat-raised-button [mat-dialog-close]="data" color="accent" cdkFocusInitial>Save</button> <button mat-raised-button [mat-dialog-close]="data" color="accent" cdkFocusInitial><i class="fas fa-plus"></i> {{ 'Common.Submit' | translate }}</button>
</div> </div>

View file

@ -254,6 +254,7 @@
"AdvancedOptions":"Advanced Options", "AdvancedOptions":"Advanced Options",
"AutoApproveOptions":"You can configure the request here, once requested it will be send to your DVR application and will be auto approved!", "AutoApproveOptions":"You can configure the request here, once requested it will be send to your DVR application and will be auto approved!",
"AutoApproveOptionsTv":"You can configure the request here, once requested it will be send to your DVR application and will be auto approved! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it!", "AutoApproveOptionsTv":"You can configure the request here, once requested it will be send to your DVR application and will be auto approved! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it!",
"AutoApproveOptionsTvShort":"You can configure the request here, once requested it will be send to your DVR application! If the request is already in Sonarr, we will not change the root folder or quality profile if you set it!",
"QualityProfilesSelect":"Select A Quality Profile", "QualityProfilesSelect":"Select A Quality Profile",
"RootFolderSelect":"Select A Root Folder", "RootFolderSelect":"Select A Root Folder",
"Status":"Status", "Status":"Status",