|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
import { Component, OnInit } from "@angular/core";
|
|
|
|
|
import { Component, OnInit, QueryList, ViewChild, ViewChildren } from "@angular/core";
|
|
|
|
|
import { FormBuilder, FormGroup } from "@angular/forms";
|
|
|
|
|
|
|
|
|
|
import { IMinimumAvailability, IRadarrCombined, IRadarrProfile, IRadarrRootFolder } from "../../interfaces";
|
|
|
|
|
import { NotificationService, SettingsService } from "../../services";
|
|
|
|
|
import { FeaturesFacade } from "../../state/features/features.facade";
|
|
|
|
|
import { RadarrFormComponent } from "./components/radarr-form.component";
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
templateUrl: "./radarr.component.html",
|
|
|
|
@ -19,11 +20,15 @@ export class RadarrComponent implements OnInit {
|
|
|
|
|
public form: FormGroup;
|
|
|
|
|
public is4kEnabled: boolean = false;
|
|
|
|
|
|
|
|
|
|
@ViewChildren('4kForm') public form4k: QueryList<RadarrFormComponent>;
|
|
|
|
|
@ViewChildren('normalForm') public normalForm: QueryList<RadarrFormComponent>;
|
|
|
|
|
|
|
|
|
|
constructor(private settingsService: SettingsService,
|
|
|
|
|
private notificationService: NotificationService,
|
|
|
|
|
private featureFacade: FeaturesFacade,
|
|
|
|
|
private fb: FormBuilder) { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ngOnInit() {
|
|
|
|
|
this.is4kEnabled = this.featureFacade.is4kEnabled();
|
|
|
|
|
this.settingsService.getRadarr()
|
|
|
|
@ -56,7 +61,16 @@ export class RadarrComponent implements OnInit {
|
|
|
|
|
scanForAvailability: [x.radarr4K.scanForAvailability]
|
|
|
|
|
}),
|
|
|
|
|
});
|
|
|
|
|
this.normalForm.changes.forEach((comp => {
|
|
|
|
|
comp.first.toggleValidators();
|
|
|
|
|
}))
|
|
|
|
|
if (this.is4kEnabled) {
|
|
|
|
|
this.form4k.changes.forEach((comp => {
|
|
|
|
|
comp.first.toggleValidators();
|
|
|
|
|
}))
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|