mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
feat: refactored the radarr setting page to support the new model
This commit is contained in:
parent
b43d49a696
commit
6c710e444f
10 changed files with 415 additions and 216 deletions
|
@ -126,6 +126,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.RottenTomatoes", "
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.I18n", "Ombi.I18n\Ombi.I18n.csproj", "{6A922D57-8622-4C36-8E6E-D5BA9E8DA6C0}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.I18n", "Ombi.I18n\Ombi.I18n.csproj", "{6A922D57-8622-4C36-8E6E-D5BA9E8DA6C0}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ombi.Api.MediaServer", "Ombi.Api.MediaServer\Ombi.Api.MediaServer.csproj", "{AFC0BA9B-E38D-479F-825A-2F94EE4D6120}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
@ -439,6 +441,12 @@ Global
|
||||||
{6A922D57-8622-4C36-8E6E-D5BA9E8DA6C0}.NonUiBuild|Any CPU.Build.0 = NonUiBuild|Any CPU
|
{6A922D57-8622-4C36-8E6E-D5BA9E8DA6C0}.NonUiBuild|Any CPU.Build.0 = NonUiBuild|Any CPU
|
||||||
{6A922D57-8622-4C36-8E6E-D5BA9E8DA6C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{6A922D57-8622-4C36-8E6E-D5BA9E8DA6C0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{6A922D57-8622-4C36-8E6E-D5BA9E8DA6C0}.Release|Any CPU.Build.0 = Release|Any CPU
|
{6A922D57-8622-4C36-8E6E-D5BA9E8DA6C0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{AFC0BA9B-E38D-479F-825A-2F94EE4D6120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{AFC0BA9B-E38D-479F-825A-2F94EE4D6120}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{AFC0BA9B-E38D-479F-825A-2F94EE4D6120}.NonUiBuild|Any CPU.ActiveCfg = NonUiBuild|Any CPU
|
||||||
|
{AFC0BA9B-E38D-479F-825A-2F94EE4D6120}.NonUiBuild|Any CPU.Build.0 = NonUiBuild|Any CPU
|
||||||
|
{AFC0BA9B-E38D-479F-825A-2F94EE4D6120}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{AFC0BA9B-E38D-479F-825A-2F94EE4D6120}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -487,6 +495,7 @@ Global
|
||||||
{E2186FDA-D827-4781-8663-130AC382F12C} = {9293CA11-360A-4C20-A674-B9E794431BF5}
|
{E2186FDA-D827-4781-8663-130AC382F12C} = {9293CA11-360A-4C20-A674-B9E794431BF5}
|
||||||
{5DE40A66-B369-469E-8626-ECE23D9D8034} = {9293CA11-360A-4C20-A674-B9E794431BF5}
|
{5DE40A66-B369-469E-8626-ECE23D9D8034} = {9293CA11-360A-4C20-A674-B9E794431BF5}
|
||||||
{8F19C701-7881-4BC7-8BBA-B068A6B954AD} = {9293CA11-360A-4C20-A674-B9E794431BF5}
|
{8F19C701-7881-4BC7-8BBA-B068A6B954AD} = {9293CA11-360A-4C20-A674-B9E794431BF5}
|
||||||
|
{AFC0BA9B-E38D-479F-825A-2F94EE4D6120} = {9293CA11-360A-4C20-A674-B9E794431BF5}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {192E9BF8-00B4-45E4-BCCC-4C215725C869}
|
SolutionGuid = {192E9BF8-00B4-45E4-BCCC-4C215725C869}
|
||||||
|
|
|
@ -158,6 +158,11 @@ export interface IRadarrSettings extends IExternalSettings {
|
||||||
scanForAvailability: boolean;
|
scanForAvailability: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IRadarrCombined {
|
||||||
|
radarr: IRadarrSettings;
|
||||||
|
radarr4K: IRadarrSettings;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ILidarrSettings extends IExternalSettings {
|
export interface ILidarrSettings extends IExternalSettings {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
apiKey: string;
|
apiKey: string;
|
||||||
|
|
|
@ -39,6 +39,7 @@ import {
|
||||||
IVoteSettings,
|
IVoteSettings,
|
||||||
ITwilioSettings,
|
ITwilioSettings,
|
||||||
IWebhookNotificationSettings,
|
IWebhookNotificationSettings,
|
||||||
|
IRadarrCombined,
|
||||||
} from "../interfaces";
|
} from "../interfaces";
|
||||||
|
|
||||||
import { ServiceHelpers } from "./service.helpers";
|
import { ServiceHelpers } from "./service.helpers";
|
||||||
|
@ -101,11 +102,11 @@ export class SettingsService extends ServiceHelpers {
|
||||||
return this.http.post<boolean>(`${this.url}/Sonarr`, JSON.stringify(settings), {headers: this.headers});
|
return this.http.post<boolean>(`${this.url}/Sonarr`, JSON.stringify(settings), {headers: this.headers});
|
||||||
}
|
}
|
||||||
|
|
||||||
public getRadarr(): Observable<IRadarrSettings> {
|
public getRadarr(): Observable<IRadarrCombined> {
|
||||||
return this.http.get<IRadarrSettings>(`${this.url}/Radarr`, {headers: this.headers});
|
return this.http.get<IRadarrCombined>(`${this.url}/Radarr`, {headers: this.headers});
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveRadarr(settings: IRadarrSettings): Observable<boolean> {
|
public saveRadarr(settings: IRadarrCombined): Observable<boolean> {
|
||||||
return this.http.post<boolean>(`${this.url}/Radarr`, JSON.stringify(settings), {headers: this.headers});
|
return this.http.post<boolean>(`${this.url}/Radarr`, JSON.stringify(settings), {headers: this.headers});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
<div [formGroup]="form">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 col-12 col-sm-12">
|
||||||
|
<div >
|
||||||
|
<div class="md-form-field">
|
||||||
|
<mat-slide-toggle formControlName="enabled" id="enable" (change)="toggleValidators()">Enable</mat-slide-toggle>
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field">
|
||||||
|
<mat-slide-toggle formControlName="scanForAvailability">Scan for Availability</mat-slide-toggle>
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field" >
|
||||||
|
<mat-slide-toggle formControlName="addOnly">
|
||||||
|
Do not search for Movies
|
||||||
|
</mat-slide-toggle>
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field" style="margin-top:1em;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-7 col-8 col-sm-12">
|
||||||
|
<label for="username" class="control-label"><h3>Radarr Server Configuration</h3></label>
|
||||||
|
<div class="md-form-field">
|
||||||
|
<mat-form-field appearance="outline" >
|
||||||
|
<mat-label>Hostname or IP</mat-label>
|
||||||
|
<input matInput formControlName="ip">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field appearance="outline" >
|
||||||
|
<mat-label>Port</mat-label>
|
||||||
|
<input matInput formControlName="port">
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-slide-toggle formControlName="ssl">
|
||||||
|
SSL
|
||||||
|
</mat-slide-toggle>
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field" style="margin-top:1em;"></div>
|
||||||
|
<div class="md-form-field">
|
||||||
|
<mat-form-field appearance="outline" >
|
||||||
|
<mat-label>API key</mat-label>
|
||||||
|
<input matInput formControlName="apiKey">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field">
|
||||||
|
<mat-form-field appearance="outline" >
|
||||||
|
<mat-label>Base URL</mat-label>
|
||||||
|
<input matInput formControlName="subDir">
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-5 col-4 col-sm-12">
|
||||||
|
<label for="username" class="control-label"><h3>Radarr Interface</h3></label>
|
||||||
|
<div class="md-form-field">
|
||||||
|
<div class="md-form-field" style="display:inline;">
|
||||||
|
<button mat-raised-button (click)="getProfiles(form)" type="button" color="primary">Load Profiles <span *ngIf="profilesRunning" class="fas fa-spinner fa-spin"></span></button>
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field" style="margin-top:1em;"></div>
|
||||||
|
<mat-form-field appearance="outline" >
|
||||||
|
<mat-label>Quality Profiles</mat-label>
|
||||||
|
<mat-select formControlName="defaultQualityProfile" required>
|
||||||
|
<mat-option *ngFor="let quality of qualities" [value]="quality.id">
|
||||||
|
{{quality.name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field">
|
||||||
|
<div class="md-form-field" style="display:inline;">
|
||||||
|
<button mat-raised-button (click)="getRootFolders(form)" type="button" color="primary">Load Root Folders <span *ngIf="rootFoldersRunning" class="fas fa-spinner fa-spin"></span></button>
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field" style="margin-top:1em;"></div>
|
||||||
|
<mat-form-field appearance="outline" >
|
||||||
|
<mat-label>Default Root Folder</mat-label>
|
||||||
|
<mat-select formControlName="defaultRootPath" required>
|
||||||
|
<mat-option *ngFor="let folder of rootFolders" [value]="folder.path">
|
||||||
|
{{folder.path}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="md-form-field">
|
||||||
|
<mat-form-field appearance="outline" >
|
||||||
|
<mat-label>Default Minimum Availability</mat-label>
|
||||||
|
<mat-select formControlName="minimumAvailability" required>
|
||||||
|
<mat-option *ngFor="let min of minimumAvailabilityOptions" [value]="min.value">
|
||||||
|
{{min.name}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="md-form-field">
|
||||||
|
<button mat-raised-button type="button" [disabled]="form.invalid" (click)="test(form)">Test Connectivity <span id="spinner"></span></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,17 @@
|
||||||
|
@import "~styles/shared.scss";
|
||||||
|
.small-middle-container {
|
||||||
|
margin: auto;
|
||||||
|
width: 95%;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.col-8 {
|
||||||
|
display: inline-table;
|
||||||
|
}
|
||||||
|
.col-md-5 {
|
||||||
|
display: inline-table;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
display: block;
|
||||||
|
}
|
|
@ -0,0 +1,94 @@
|
||||||
|
import { ChangeDetectionStrategy, Component, OnInit } from "@angular/core";
|
||||||
|
import { ControlContainer, FormGroup, Validators } from "@angular/forms";
|
||||||
|
|
||||||
|
import { IMinimumAvailability, IRadarrProfile, IRadarrRootFolder } from "../../../interfaces";
|
||||||
|
import { IRadarrSettings } from "../../../interfaces";
|
||||||
|
import { RadarrService } from "../../../services";
|
||||||
|
import { TesterService } from "../../../services";
|
||||||
|
import { NotificationService } from "../../../services";
|
||||||
|
import { SettingsService } from "../../../services";
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: "ombi-settings-radarr-form",
|
||||||
|
templateUrl: "./radarr-form.component.html",
|
||||||
|
styleUrls: ["./radarr-form.component.scss"],
|
||||||
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
|
})
|
||||||
|
export class RadarrFormComponent implements OnInit {
|
||||||
|
|
||||||
|
public qualities: IRadarrProfile[];
|
||||||
|
public rootFolders: IRadarrRootFolder[];
|
||||||
|
public minimumAvailabilityOptions: IMinimumAvailability[];
|
||||||
|
public profilesRunning: boolean;
|
||||||
|
public rootFoldersRunning: boolean;
|
||||||
|
public form: FormGroup;
|
||||||
|
|
||||||
|
constructor(private radarrService: RadarrService,
|
||||||
|
private notificationService: NotificationService,
|
||||||
|
private testerService: TesterService,
|
||||||
|
private controlContainer: ControlContainer) { }
|
||||||
|
|
||||||
|
public ngOnInit() {
|
||||||
|
this.form = <FormGroup>this.controlContainer.control;
|
||||||
|
|
||||||
|
this.qualities = [];
|
||||||
|
this.qualities.push({ name: "Please Select", id: -1 });
|
||||||
|
|
||||||
|
this.rootFolders = [];
|
||||||
|
this.rootFolders.push({ path: "Please Select", id: -1 });
|
||||||
|
this.minimumAvailabilityOptions = [
|
||||||
|
{ name: "Announced", value: "Announced" },
|
||||||
|
{ name: "In Cinemas", value: "InCinemas" },
|
||||||
|
{ name: "Physical / Web", value: "Released" },
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public toggleValidators() {
|
||||||
|
const enabled = this.form.controls.enabled.value as boolean;
|
||||||
|
this.form.controls.apiKey.setValidators(enabled ? [Validators.required] : null);
|
||||||
|
this.form.controls.defaultQualityProfile.setValidators(enabled ? [Validators.required] : null);
|
||||||
|
this.form.controls.defaultRootPath.setValidators(enabled ? [Validators.required] : null);
|
||||||
|
this.form.controls.ip.setValidators(enabled ? [Validators.required] : null);
|
||||||
|
this.form.controls.port.setValidators(enabled ? [Validators.required] : null);
|
||||||
|
this.form.controls.minimumAvailability.setValidators(enabled ? [Validators.required] : null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getProfiles(form: FormGroup) {
|
||||||
|
this.profilesRunning = true;
|
||||||
|
this.radarrService.getQualityProfiles(form.value).subscribe(x => {
|
||||||
|
this.qualities = x;
|
||||||
|
this.qualities.unshift({ name: "Please Select", id: -1 });
|
||||||
|
|
||||||
|
this.profilesRunning = false;
|
||||||
|
this.notificationService.success("Successfully retrieved the Quality Profiles");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public getRootFolders(form: FormGroup) {
|
||||||
|
this.rootFoldersRunning = true;
|
||||||
|
this.radarrService.getRootFolders(form.value).subscribe(x => {
|
||||||
|
this.rootFolders = x;
|
||||||
|
this.rootFolders.unshift({ path: "Please Select", id: -1 });
|
||||||
|
|
||||||
|
this.rootFoldersRunning = false;
|
||||||
|
this.notificationService.success("Successfully retrieved the Root Folders");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public test(form: FormGroup) {
|
||||||
|
if (form.invalid) {
|
||||||
|
this.notificationService.error("Please check your entered values");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const settings = <IRadarrSettings> form.value;
|
||||||
|
this.testerService.radarrTest(settings).subscribe(result => {
|
||||||
|
if (result.isValid) {
|
||||||
|
this.notificationService.success("Successfully connected to Radarr!");
|
||||||
|
} else if (result.expectedSubDir) {
|
||||||
|
this.notificationService.error("Your Radarr Base URL must be set to " + result.expectedSubDir);
|
||||||
|
} else {
|
||||||
|
this.notificationService.error("We could not connect to Radarr!");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,108 +4,19 @@
|
||||||
<legend>Radarr Settings</legend>
|
<legend>Radarr Settings</legend>
|
||||||
<div class="md-form-field" style="margin-top:1em;"></div>
|
<div class="md-form-field" style="margin-top:1em;"></div>
|
||||||
<form novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
|
<form novalidate [formGroup]="form" (ngSubmit)="onSubmit(form)">
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 col-12 col-sm-12">
|
|
||||||
<div >
|
|
||||||
<div class="md-form-field">
|
|
||||||
<mat-slide-toggle formControlName="enabled" id="enable">Enable</mat-slide-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field">
|
|
||||||
<mat-slide-toggle formControlName="scanForAvailability">Scan for Availability</mat-slide-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field" >
|
|
||||||
<mat-slide-toggle formControlName="addOnly">
|
|
||||||
Do not search for Movies
|
|
||||||
</mat-slide-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field" style="margin-top:1em;"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-7 col-8 col-sm-12">
|
|
||||||
<label for="username" class="control-label"><h3>Radarr Server Configuration</h3></label>
|
|
||||||
<div class="md-form-field">
|
|
||||||
<mat-form-field appearance="outline" >
|
|
||||||
<mat-label>Hostname or IP</mat-label>
|
|
||||||
<input matInput formControlName="ip">
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-form-field appearance="outline" >
|
|
||||||
<mat-label>Port</mat-label>
|
|
||||||
<input matInput formControlName="port">
|
|
||||||
</mat-form-field>
|
|
||||||
<mat-slide-toggle formControlName="ssl">
|
|
||||||
SSL
|
|
||||||
</mat-slide-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field" style="margin-top:1em;"></div>
|
|
||||||
<div class="md-form-field">
|
|
||||||
<mat-form-field appearance="outline" >
|
|
||||||
<mat-label>API key</mat-label>
|
|
||||||
<input matInput formControlName="apiKey">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field">
|
|
||||||
<mat-form-field appearance="outline" >
|
|
||||||
<mat-label>Base URL</mat-label>
|
|
||||||
<input matInput formControlName="subDir">
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-5 col-4 col-sm-12">
|
|
||||||
<label for="username" class="control-label"><h3>Radarr Interface</h3></label>
|
|
||||||
<div class="md-form-field">
|
|
||||||
<div class="md-form-field" style="display:inline;">
|
|
||||||
<button mat-raised-button (click)="getProfiles(form)" type="button" color="primary">Load Profiles <span *ngIf="profilesRunning" class="fas fa-spinner fa-spin"></span></button>
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field" style="margin-top:1em;"></div>
|
|
||||||
<mat-form-field appearance="outline" >
|
|
||||||
<mat-label>Quality Profiles</mat-label>
|
|
||||||
<mat-select formControlName="defaultQualityProfile" required>
|
|
||||||
<mat-option *ngFor="let quality of qualities" [value]="quality.id">
|
|
||||||
{{quality.name}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
</div>
|
<ombi-settings-radarr-form formGroupName="radarr">
|
||||||
<div class="md-form-field">
|
|
||||||
<div class="md-form-field" style="display:inline;">
|
</ombi-settings-radarr-form>
|
||||||
<button mat-raised-button (click)="getRootFolders(form)" type="button" color="primary">Load Root Folders <span *ngIf="rootFoldersRunning" class="fas fa-spinner fa-spin"></span></button>
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field" style="margin-top:1em;"></div>
|
|
||||||
<mat-form-field appearance="outline" >
|
|
||||||
<mat-label>Default Root Folder</mat-label>
|
|
||||||
<mat-select formControlName="defaultRootPath" required>
|
|
||||||
<mat-option *ngFor="let folder of rootFolders" [value]="folder.path">
|
|
||||||
{{folder.path}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field">
|
|
||||||
<mat-form-field appearance="outline" >
|
|
||||||
<mat-label>Default Minimum Availability</mat-label>
|
|
||||||
<mat-select formControlName="minimumAvailability" required>
|
|
||||||
<mat-option *ngFor="let min of minimumAvailabilityOptions" [value]="min.value">
|
|
||||||
{{min.name}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</mat-form-field>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-12">
|
|
||||||
<div class="md-form-field">
|
|
||||||
<button mat-raised-button type="button" [disabled]="form.invalid" (click)="test(form)">Test Connectivity <span id="spinner"></span></button>
|
|
||||||
</div>
|
|
||||||
<div class="md-form-field" style="margin-top:1em;">
|
<div class="md-form-field" style="margin-top:1em;">
|
||||||
<button mat-raised-button type="submit" color="primary" [disabled]="form.invalid" class="mat-focus-indicator mat-stroked-button accent mat-accent mat-raised-button mat-button-base" ng-reflect-disabled="false"><span class="mat-button-wrapper">Submit</span><div matripple="" class="mat-ripple mat-button-ripple" ng-reflect-disabled="false" ng-reflect-centered="false" ng-reflect-trigger="[object HTMLButtonElement]"></div><div class="mat-button-focus-overlay"></div></button>
|
<button mat-raised-button type="submit" color="primary" [disabled]="form.invalid" class="mat-focus-indicator mat-stroked-button accent mat-accent mat-raised-button mat-button-base" ng-reflect-disabled="false"><span class="mat-button-wrapper">Submit</span><div matripple="" class="mat-ripple mat-button-ripple" ng-reflect-disabled="false" ng-reflect-centered="false" ng-reflect-trigger="[object HTMLButtonElement]"></div><div class="mat-button-focus-overlay"></div></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<pre>
|
||||||
|
{{ form.value | json }}
|
||||||
|
</pre>
|
|
@ -1,7 +1,7 @@
|
||||||
import { Component, OnInit } from "@angular/core";
|
import { Component, OnInit } from "@angular/core";
|
||||||
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
|
||||||
|
|
||||||
import { IMinimumAvailability, IRadarrProfile, IRadarrRootFolder } from "../../interfaces";
|
import { IMinimumAvailability, IRadarrCombined, IRadarrProfile, IRadarrRootFolder } from "../../interfaces";
|
||||||
import { IRadarrSettings } from "../../interfaces";
|
import { IRadarrSettings } from "../../interfaces";
|
||||||
import { RadarrService } from "../../services";
|
import { RadarrService } from "../../services";
|
||||||
import { TesterService } from "../../services";
|
import { TesterService } from "../../services";
|
||||||
|
@ -30,92 +30,55 @@ export class RadarrComponent implements OnInit {
|
||||||
public ngOnInit() {
|
public ngOnInit() {
|
||||||
this.settingsService.getRadarr()
|
this.settingsService.getRadarr()
|
||||||
.subscribe(x => {
|
.subscribe(x => {
|
||||||
|
|
||||||
this.form = this.fb.group({
|
this.form = this.fb.group({
|
||||||
enabled: [x.enabled],
|
radarr: this.fb.group({
|
||||||
apiKey: [x.apiKey, [Validators.required]],
|
enabled: [x.radarr.enabled],
|
||||||
defaultQualityProfile: [+x.defaultQualityProfile, [Validators.required]],
|
apiKey: [x.radarr.apiKey],
|
||||||
defaultRootPath: [x.defaultRootPath, [Validators.required]],
|
defaultQualityProfile: [+x.radarr.defaultQualityProfile],
|
||||||
ssl: [x.ssl],
|
defaultRootPath: [x.radarr.defaultRootPath],
|
||||||
subDir: [x.subDir],
|
ssl: [x.radarr.ssl],
|
||||||
ip: [x.ip, [Validators.required]],
|
subDir: [x.radarr.subDir],
|
||||||
port: [x.port, [Validators.required]],
|
ip: [x.radarr.ip],
|
||||||
addOnly: [x.addOnly],
|
port: [x.radarr.port],
|
||||||
minimumAvailability: [x.minimumAvailability, [Validators.required]],
|
addOnly: [x.radarr.addOnly],
|
||||||
scanForAvailability: [x.scanForAvailability]
|
minimumAvailability: [x.radarr.minimumAvailability],
|
||||||
|
scanForAvailability: [x.radarr.scanForAvailability]
|
||||||
|
}),
|
||||||
|
radarr4K: this.fb.group({
|
||||||
|
enabled: [x.radarr.enabled],
|
||||||
|
apiKey: [x.radarr.apiKey],
|
||||||
|
defaultQualityProfile: [+x.radarr.defaultQualityProfile],
|
||||||
|
defaultRootPath: [x.radarr.defaultRootPath],
|
||||||
|
ssl: [x.radarr.ssl],
|
||||||
|
subDir: [x.radarr.subDir],
|
||||||
|
ip: [x.radarr.ip],
|
||||||
|
port: [x.radarr.port],
|
||||||
|
addOnly: [x.radarr.addOnly],
|
||||||
|
minimumAvailability: [x.radarr.minimumAvailability],
|
||||||
|
scanForAvailability: [x.radarr.scanForAvailability]
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (x.defaultQualityProfile) {
|
|
||||||
this.getProfiles(this.form);
|
|
||||||
}
|
|
||||||
if (x.defaultRootPath) {
|
|
||||||
this.getRootFolders(this.form);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.qualities = [];
|
|
||||||
this.qualities.push({ name: "Please Select", id: -1 });
|
|
||||||
|
|
||||||
this.rootFolders = [];
|
|
||||||
this.rootFolders.push({ path: "Please Select", id: -1 });
|
|
||||||
this.minimumAvailabilityOptions = [
|
|
||||||
{ name: "Announced", value: "Announced" },
|
|
||||||
{ name: "In Cinemas", value: "InCinemas" },
|
|
||||||
{ name: "Physical / Web", value: "Released" },
|
|
||||||
];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public getProfiles(form: FormGroup) {
|
|
||||||
this.profilesRunning = true;
|
|
||||||
this.radarrService.getQualityProfiles(form.value).subscribe(x => {
|
|
||||||
this.qualities = x;
|
|
||||||
this.qualities.unshift({ name: "Please Select", id: -1 });
|
|
||||||
|
|
||||||
this.profilesRunning = false;
|
|
||||||
this.notificationService.success("Successfully retrieved the Quality Profiles");
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public getRootFolders(form: FormGroup) {
|
|
||||||
this.rootFoldersRunning = true;
|
|
||||||
this.radarrService.getRootFolders(form.value).subscribe(x => {
|
|
||||||
this.rootFolders = x;
|
|
||||||
this.rootFolders.unshift({ path: "Please Select", id: -1 });
|
|
||||||
|
|
||||||
this.rootFoldersRunning = false;
|
|
||||||
this.notificationService.success("Successfully retrieved the Root Folders");
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public test(form: FormGroup) {
|
|
||||||
if (form.invalid) {
|
|
||||||
this.notificationService.error("Please check your entered values");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const settings = <IRadarrSettings> form.value;
|
|
||||||
this.testerService.radarrTest(settings).subscribe(result => {
|
|
||||||
if (result.isValid) {
|
|
||||||
this.notificationService.success("Successfully connected to Radarr!");
|
|
||||||
} else if (result.expectedSubDir) {
|
|
||||||
this.notificationService.error("Your Radarr Base URL must be set to " + result.expectedSubDir);
|
|
||||||
} else {
|
|
||||||
this.notificationService.error("We could not connect to Radarr!");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public onSubmit(form: FormGroup) {
|
public onSubmit(form: FormGroup) {
|
||||||
if (form.invalid) {
|
if (form.invalid) {
|
||||||
this.notificationService.error("Please check your entered values");
|
this.notificationService.error("Please check your entered values");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (form.controls.defaultQualityProfile.value === "-1" || form.controls.defaultRootPath.value === "Please Select") {
|
const radarrForm = form.controls.radarr as FormGroup;
|
||||||
this.notificationService.error("Please check your entered values");
|
const radarr4KForm = form.controls.radarr4K as FormGroup;
|
||||||
|
if (radarrForm.controls.enabled && (radarrForm.controls.defaultQualityProfile.value === "-1" || radarrForm.controls.defaultRootPath.value === "Please Select")) {
|
||||||
|
this.notificationService.error("Please check your entered values for Radarr");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (radarr4KForm.controls.enabled && (radarr4KForm.controls.defaultQualityProfile.value === "-1" || radarr4KForm.controls.defaultRootPath.value === "Please Select")) {
|
||||||
|
this.notificationService.error("Please check your entered values for Radarr 4K");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const settings = <IRadarrSettings> form.value;
|
const settings = <IRadarrCombined> form.value;
|
||||||
this.settingsService.saveRadarr(settings).subscribe(x => {
|
this.settingsService.saveRadarr(settings).subscribe(x => {
|
||||||
if (x) {
|
if (x) {
|
||||||
this.notificationService.success("Successfully saved Radarr settings");
|
this.notificationService.success("Successfully saved Radarr settings");
|
||||||
|
|
|
@ -1,76 +1,155 @@
|
||||||
import { CommonModule } from "@angular/common";
|
import {
|
||||||
import { NgModule } from "@angular/core";
|
CouchPotatoService,
|
||||||
|
EmbyService,
|
||||||
|
FileDownloadService,
|
||||||
|
IssuesService,
|
||||||
|
JellyfinService,
|
||||||
|
JobService,
|
||||||
|
LidarrService,
|
||||||
|
MobileService,
|
||||||
|
NotificationMessageService,
|
||||||
|
PlexService,
|
||||||
|
RadarrService,
|
||||||
|
RequestRetryService,
|
||||||
|
SonarrService,
|
||||||
|
SystemService,
|
||||||
|
TesterService,
|
||||||
|
TheMovieDbService,
|
||||||
|
ValidationService
|
||||||
|
} from "../services";
|
||||||
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
|
||||||
import { RouterModule, Routes } from "@angular/router";
|
import { RouterModule, Routes } from "@angular/router";
|
||||||
// import { TagInputModule } from "ngx-chips";
|
|
||||||
import { ClipboardModule } from "ngx-clipboard";
|
|
||||||
|
|
||||||
|
import { AboutComponent } from "./about/about.component";
|
||||||
import { AuthGuard } from "../auth/auth.guard";
|
import { AuthGuard } from "../auth/auth.guard";
|
||||||
import { AuthService } from "../auth/auth.service";
|
import { AuthService } from "../auth/auth.service";
|
||||||
import {
|
|
||||||
CouchPotatoService, EmbyService, JellyfinService, IssuesService, JobService, LidarrService, MobileService, NotificationMessageService, PlexService, RadarrService,
|
|
||||||
RequestRetryService, SonarrService, TesterService, ValidationService, SystemService, FileDownloadService, TheMovieDbService
|
|
||||||
} from "../services";
|
|
||||||
|
|
||||||
import { PipeModule } from "../pipes/pipe.module";
|
|
||||||
import { AboutComponent } from "./about/about.component";
|
|
||||||
import { AuthenticationComponent } from "./authentication/authentication.component";
|
import { AuthenticationComponent } from "./authentication/authentication.component";
|
||||||
|
import {AutoCompleteModule} from "primeng/autocomplete";
|
||||||
|
import {CalendarModule} from "primeng/calendar";
|
||||||
|
import { ClipboardModule } from "ngx-clipboard";
|
||||||
|
import { CloudMobileComponent } from "./notifications/cloudmobile.coponent";
|
||||||
|
import { CloudMobileService } from "../services/cloudmobile.service";
|
||||||
|
import { CommonModule } from "@angular/common";
|
||||||
import { CouchPotatoComponent } from "./couchpotato/couchpotato.component";
|
import { CouchPotatoComponent } from "./couchpotato/couchpotato.component";
|
||||||
import { CustomizationComponent } from "./customization/customization.component";
|
import { CustomizationComponent } from "./customization/customization.component";
|
||||||
|
import {DialogModule} from "primeng/dialog";
|
||||||
|
import { DiscordComponent } from "./notifications/discord.component";
|
||||||
import { DogNzbComponent } from "./dognzb/dognzb.component";
|
import { DogNzbComponent } from "./dognzb/dognzb.component";
|
||||||
|
import { EmailNotificationComponent } from "./notifications/emailnotification.component";
|
||||||
import { EmbyComponent } from "./emby/emby.component";
|
import { EmbyComponent } from "./emby/emby.component";
|
||||||
import { JellyfinComponent } from "./jellyfin/jellyfin.component";
|
|
||||||
import { FailedRequestsComponent } from "./failedrequests/failedrequests.component";
|
import { FailedRequestsComponent } from "./failedrequests/failedrequests.component";
|
||||||
|
import { GotifyComponent } from "./notifications/gotify.component";
|
||||||
|
import { HubService } from "../services/hub.service";
|
||||||
|
import {InputSwitchModule} from "primeng/inputswitch";
|
||||||
|
import {InputTextModule} from "primeng/inputtext";
|
||||||
import { IssuesComponent } from "./issues/issues.component";
|
import { IssuesComponent } from "./issues/issues.component";
|
||||||
|
import { JellyfinComponent } from "./jellyfin/jellyfin.component";
|
||||||
import { JobsComponent } from "./jobs/jobs.component";
|
import { JobsComponent } from "./jobs/jobs.component";
|
||||||
import { LandingPageComponent } from "./landingpage/landingpage.component";
|
import { LandingPageComponent } from "./landingpage/landingpage.component";
|
||||||
import { LidarrComponent } from "./lidarr/lidarr.component";
|
import { LidarrComponent } from "./lidarr/lidarr.component";
|
||||||
|
import { LogsComponent } from "./logs/logs.component";
|
||||||
import { MassEmailComponent } from "./massemail/massemail.component";
|
import { MassEmailComponent } from "./massemail/massemail.component";
|
||||||
import { DiscordComponent } from "./notifications/discord.component";
|
import { MatDialogModule } from "@angular/material/dialog";
|
||||||
import { EmailNotificationComponent } from "./notifications/emailnotification.component";
|
import { MatMenuModule } from "@angular/material/menu";
|
||||||
import { GotifyComponent } from "./notifications/gotify.component";
|
|
||||||
import { MattermostComponent } from "./notifications/mattermost.component";
|
import { MattermostComponent } from "./notifications/mattermost.component";
|
||||||
|
import {MenuModule} from "primeng/menu";
|
||||||
import { MobileComponent } from "./notifications/mobile.component";
|
import { MobileComponent } from "./notifications/mobile.component";
|
||||||
import { NewsletterComponent } from "./notifications/newsletter.component";
|
import { NewsletterComponent } from "./notifications/newsletter.component";
|
||||||
|
import { NgModule } from "@angular/core";
|
||||||
import { NotificationTemplate } from "./notifications/notificationtemplate.component";
|
import { NotificationTemplate } from "./notifications/notificationtemplate.component";
|
||||||
|
import { OmbiComponent } from "./ombi/ombi.component";
|
||||||
|
import { PipeModule } from "../pipes/pipe.module";
|
||||||
|
import { PlexComponent } from "./plex/plex.component";
|
||||||
import { PushbulletComponent } from "./notifications/pushbullet.component";
|
import { PushbulletComponent } from "./notifications/pushbullet.component";
|
||||||
import { PushoverComponent } from "./notifications/pushover.component";
|
import { PushoverComponent } from "./notifications/pushover.component";
|
||||||
import { SlackComponent } from "./notifications/slack.component";
|
|
||||||
import { TelegramComponent } from "./notifications/telegram.component";
|
|
||||||
import { WebhookComponent } from "./notifications/webhook.component";
|
|
||||||
import { OmbiComponent } from "./ombi/ombi.component";
|
|
||||||
import { PlexComponent } from "./plex/plex.component";
|
|
||||||
import { RadarrComponent } from "./radarr/radarr.component";
|
import { RadarrComponent } from "./radarr/radarr.component";
|
||||||
|
import { RadarrFormComponent } from "./radarr/components/radarr-form.component";
|
||||||
|
import {RadioButtonModule} from "primeng/radiobutton";
|
||||||
|
import { SettingsMenuComponent } from "./settingsmenu.component";
|
||||||
|
import { SharedModule } from "../shared/shared.module";
|
||||||
import { SickRageComponent } from "./sickrage/sickrage.component";
|
import { SickRageComponent } from "./sickrage/sickrage.component";
|
||||||
|
import { SlackComponent } from "./notifications/slack.component";
|
||||||
import { SonarrComponent } from "./sonarr/sonarr.component";
|
import { SonarrComponent } from "./sonarr/sonarr.component";
|
||||||
|
import { TelegramComponent } from "./notifications/telegram.component";
|
||||||
import { TheMovieDbComponent } from "./themoviedb/themoviedb.component";
|
import { TheMovieDbComponent } from "./themoviedb/themoviedb.component";
|
||||||
|
import {TooltipModule} from "primeng/tooltip";
|
||||||
|
import { TwilioComponent } from "./notifications/twilio/twilio.component";
|
||||||
import { UpdateComponent } from "./update/update.component";
|
import { UpdateComponent } from "./update/update.component";
|
||||||
|
import { UpdateDialogComponent } from "./about/update-dialog.component";
|
||||||
|
import { UpdateService } from "../services/update.service";
|
||||||
import { UserManagementComponent } from "./usermanagement/usermanagement.component";
|
import { UserManagementComponent } from "./usermanagement/usermanagement.component";
|
||||||
import { VoteComponent } from "./vote/vote.component";
|
import { VoteComponent } from "./vote/vote.component";
|
||||||
|
import { WebhookComponent } from "./notifications/webhook.component";
|
||||||
|
import { WhatsAppComponent } from "./notifications/twilio/whatsapp.component";
|
||||||
import { WikiComponent } from "./wiki.component";
|
import { WikiComponent } from "./wiki.component";
|
||||||
|
|
||||||
import { SettingsMenuComponent } from "./settingsmenu.component";
|
// import { TagInputModule } from "ngx-chips";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import {AutoCompleteModule } from "primeng/autocomplete";
|
|
||||||
import {CalendarModule } from "primeng/calendar";
|
|
||||||
import {InputSwitchModule } from "primeng/inputswitch";
|
|
||||||
import {InputTextModule } from "primeng/inputtext";
|
|
||||||
import {DialogModule } from "primeng/dialog";
|
|
||||||
import {MenuModule } from "primeng/menu";
|
|
||||||
import {RadioButtonModule } from "primeng/radiobutton";
|
|
||||||
import {TooltipModule } from "primeng/tooltip";
|
|
||||||
|
|
||||||
import { MatMenuModule } from "@angular/material/menu";
|
|
||||||
import { SharedModule } from "../shared/shared.module";
|
|
||||||
import { HubService } from "../services/hub.service";
|
|
||||||
import { LogsComponent } from "./logs/logs.component";
|
|
||||||
import { TwilioComponent } from "./notifications/twilio/twilio.component";
|
|
||||||
import { WhatsAppComponent } from "./notifications/twilio/whatsapp.component";
|
|
||||||
import { CloudMobileComponent } from "./notifications/cloudmobile.coponent";
|
|
||||||
import { CloudMobileService } from "../services/cloudmobile.service";
|
|
||||||
import { UpdateService } from "../services/update.service";
|
|
||||||
import { MatDialogModule } from "@angular/material/dialog";
|
|
||||||
import { UpdateDialogComponent } from "./about/update-dialog.component";
|
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{ path: "Ombi", component: OmbiComponent, canActivate: [AuthGuard] },
|
{ path: "Ombi", component: OmbiComponent, canActivate: [AuthGuard] },
|
||||||
|
@ -145,6 +224,7 @@ const routes: Routes = [
|
||||||
SonarrComponent,
|
SonarrComponent,
|
||||||
SlackComponent,
|
SlackComponent,
|
||||||
RadarrComponent,
|
RadarrComponent,
|
||||||
|
RadarrFormComponent,
|
||||||
EmailNotificationComponent,
|
EmailNotificationComponent,
|
||||||
NotificationTemplate,
|
NotificationTemplate,
|
||||||
PushoverComponent,
|
PushoverComponent,
|
||||||
|
|
18
src/Ombi/Ombi.Api.MediaServer.csproj
Normal file
18
src/Ombi/Ombi.Api.MediaServer.csproj
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<AssemblyVersion>3.0.0.0</AssemblyVersion>
|
||||||
|
<FileVersion>3.0.0.0</FileVersion>
|
||||||
|
<Version></Version>
|
||||||
|
<PackageVersion></PackageVersion>
|
||||||
|
<LangVersion>8.0</LangVersion>
|
||||||
|
<Configurations>Debug;Release;NonUiBuild</Configurations>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
|
||||||
|
<ProjectReference Include="..\Ombi.Helpers\Ombi.Helpers.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
Add table
Add a link
Reference in a new issue