1
1
import { Component , Inject , OnInit } from "@angular/core" ;
2
2
import { MatDialogRef , MAT_DIALOG_DATA } from "@angular/material/dialog" ;
3
- import { IAdvancedData , IRadarrProfile , IRadarrRootFolder } from "../../../../../interfaces" ;
3
+ import { IAdvancedData , IRadarrProfile , IRadarrRootFolder , RequestCombination } from "../../../../../interfaces" ;
4
4
import { RadarrService } from "../../../../../services" ;
5
5
6
6
@Component ( {
@@ -11,6 +11,8 @@ export class MovieAdvancedOptionsComponent implements OnInit {
11
11
12
12
public radarrProfiles : IRadarrProfile [ ] ;
13
13
public radarrRootFolders : IRadarrRootFolder [ ] ;
14
+ public show4k : boolean = false ;
15
+ public showNormal : boolean = false ;
14
16
15
17
constructor ( public dialogRef : MatDialogRef < MovieAdvancedOptionsComponent > , @Inject ( MAT_DIALOG_DATA ) public data : IAdvancedData ,
16
18
private radarrService : RadarrService
@@ -19,16 +21,31 @@ export class MovieAdvancedOptionsComponent implements OnInit {
19
21
20
22
21
23
public async ngOnInit ( ) {
22
- this . radarrService . getQualityProfilesFromSettings ( ) . subscribe ( c => {
23
- this . radarrProfiles = c ;
24
- this . data . profiles = c ;
25
- this . setQualityOverrides ( ) ;
26
- } ) ;
27
- this . radarrService . getRootFoldersFromSettings ( ) . subscribe ( c => {
28
- this . radarrRootFolders = c ;
29
- this . data . rootFolders = c ;
30
- this . setRootFolderOverrides ( ) ;
31
- } ) ;
24
+ this . show4k = this . data . movieRequest . requestCombination === RequestCombination . FourK || this . data . movieRequest . requestCombination === RequestCombination . Both ;
25
+ this . showNormal = this . data . movieRequest . requestCombination === RequestCombination . Normal || this . data . movieRequest . requestCombination === RequestCombination . Both ;
26
+ if ( this . show4k ) {
27
+ this . radarrService . getQualityProfiles4kFromSettings ( ) . subscribe ( c => {
28
+ this . radarrProfiles = c ;
29
+ this . data . profiles4k = c ;
30
+ this . setQualityOverrides ( ) ;
31
+ } ) ;
32
+ this . radarrService . getRootFolders4kFromSettings ( ) . subscribe ( c => {
33
+ this . radarrRootFolders = c ;
34
+ this . data . rootFolders4k = c ;
35
+ this . setRootFolderOverrides ( ) ;
36
+ } ) ;
37
+ } else { // Currently show either 4k or normal, if it's a dual request there needs to be more work done to save the overrides for 4k separately
38
+ this . radarrService . getQualityProfilesFromSettings ( ) . subscribe ( c => {
39
+ this . radarrProfiles = c ;
40
+ this . data . profiles = c ;
41
+ this . setQualityOverrides ( ) ;
42
+ } ) ;
43
+ this . radarrService . getRootFoldersFromSettings ( ) . subscribe ( c => {
44
+ this . radarrRootFolders = c ;
45
+ this . data . rootFolders = c ;
46
+ this . setRootFolderOverrides ( ) ;
47
+ } ) ;
48
+ }
32
49
}
33
50
34
51
private setQualityOverrides ( ) : void {
0 commit comments