diff --git a/src/Ombi.Store/Entities/Requests/MovieRequests.cs b/src/Ombi.Store/Entities/Requests/MovieRequests.cs index 3c3c75893..dbcb63c69 100644 --- a/src/Ombi.Store/Entities/Requests/MovieRequests.cs +++ b/src/Ombi.Store/Entities/Requests/MovieRequests.cs @@ -44,6 +44,21 @@ namespace Ombi.Store.Entities.Requests public DateTime MarkedAsDenied4K { get; set; } public string DeniedReason4K { get; set; } + [NotMapped] + public RequestCombination RequestCombination + { + get + { + if (Has4KRequest && RequestedDate != default) + { + return RequestCombination.Both; + } + if (Has4KRequest) { return RequestCombination.FourK; } + + return RequestCombination.Normal; + } + } + /// /// Only Use for setting the Language Code, Use the LanguageCode property for reading diff --git a/src/Ombi.Store/Entities/Requests/RequestCombination.cs b/src/Ombi.Store/Entities/Requests/RequestCombination.cs new file mode 100644 index 000000000..048d35c19 --- /dev/null +++ b/src/Ombi.Store/Entities/Requests/RequestCombination.cs @@ -0,0 +1,9 @@ +namespace Ombi.Store.Entities.Requests +{ + public enum RequestCombination + { + Normal, + FourK, + Both + } +} diff --git a/src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts b/src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts index 7270e125b..033b1c02a 100644 --- a/src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts +++ b/src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts @@ -25,12 +25,19 @@ export interface IMovieRequests extends IFullBaseRequest { requestedDate: Date; watchedByRequestedUser: boolean; playedByUsersCount: number; + requestCombination: RequestCombination; // For the UI rootPathOverrideTitle: string; qualityOverrideTitle: string; } +export enum RequestCombination { + Normal, + FourK, + Both +} + export interface IMovieAdvancedOptions { requestId: number; qualityOverride: number; diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.ts index d164644ff..097034bb7 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.ts @@ -1,6 +1,6 @@ import { Component, Inject, OnInit } from "@angular/core"; import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog"; -import { IAdvancedData, IRadarrProfile, IRadarrRootFolder } from "../../../../../interfaces"; +import { IAdvancedData, IRadarrProfile, IRadarrRootFolder, RequestCombination } from "../../../../../interfaces"; import { RadarrService } from "../../../../../services"; @Component({ @@ -11,6 +11,8 @@ export class MovieAdvancedOptionsComponent implements OnInit { public radarrProfiles: IRadarrProfile[]; public radarrRootFolders: IRadarrRootFolder[]; + public show4k: boolean = false; + public showNormal: boolean = false; constructor(public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: IAdvancedData, private radarrService: RadarrService @@ -19,16 +21,31 @@ export class MovieAdvancedOptionsComponent implements OnInit { public async ngOnInit() { - this.radarrService.getQualityProfilesFromSettings().subscribe(c => { - this.radarrProfiles = c; - this.data.profiles = c; - this.setQualityOverrides(); - }); - this.radarrService.getRootFoldersFromSettings().subscribe(c => { - this.radarrRootFolders = c; - this.data.rootFolders = c; - this.setRootFolderOverrides(); - }); + this.show4k = this.data.movieRequest.requestCombination === RequestCombination.FourK || this.data.movieRequest.requestCombination === RequestCombination.Both; + this.showNormal = this.data.movieRequest.requestCombination === RequestCombination.Normal || this.data.movieRequest.requestCombination === RequestCombination.Both; + if (this.show4k) { + this.radarrService.getQualityProfiles4kFromSettings().subscribe(c => { + this.radarrProfiles = c; + this.data.profiles4k = c; + this.setQualityOverrides(); + }); + this.radarrService.getRootFolders4kFromSettings().subscribe(c => { + this.radarrRootFolders = c; + this.data.rootFolders4k = c; + this.setRootFolderOverrides(); + }); + } 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 + this.radarrService.getQualityProfilesFromSettings().subscribe(c => { + this.radarrProfiles = c; + this.data.profiles = c; + this.setQualityOverrides(); + }); + this.radarrService.getRootFoldersFromSettings().subscribe(c => { + this.radarrRootFolders = c; + this.data.rootFolders = c; + this.setRootFolderOverrides(); + }); + } } private setQualityOverrides(): void {