Skip to content

Commit 0fb29a0

Browse files
committed
fix(radarr-4k): 🐛 Fixed an issue where the overrides wouldn't work for 4k Requests
1 parent 938a0b7 commit 0fb29a0

File tree

4 files changed

+59
-11
lines changed

4 files changed

+59
-11
lines changed

src/Ombi.Store/Entities/Requests/MovieRequests.cs

+15
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ public MovieRequests()
4444
public DateTime MarkedAsDenied4K { get; set; }
4545
public string DeniedReason4K { get; set; }
4646

47+
[NotMapped]
48+
public RequestCombination RequestCombination
49+
{
50+
get
51+
{
52+
if (Has4KRequest && RequestedDate != default)
53+
{
54+
return RequestCombination.Both;
55+
}
56+
if (Has4KRequest) { return RequestCombination.FourK; }
57+
58+
return RequestCombination.Normal;
59+
}
60+
}
61+
4762

4863
/// <summary>
4964
/// Only Use for setting the Language Code, Use the LanguageCode property for reading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Ombi.Store.Entities.Requests
2+
{
3+
public enum RequestCombination
4+
{
5+
Normal,
6+
FourK,
7+
Both
8+
}
9+
}

src/Ombi/ClientApp/src/app/interfaces/IRequestModel.ts

+7
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@ export interface IMovieRequests extends IFullBaseRequest {
2525
requestedDate: Date;
2626
watchedByRequestedUser: boolean;
2727
playedByUsersCount: number;
28+
requestCombination: RequestCombination;
2829

2930
// For the UI
3031
rootPathOverrideTitle: string;
3132
qualityOverrideTitle: string;
3233
}
3334

35+
export enum RequestCombination {
36+
Normal,
37+
FourK,
38+
Both
39+
}
40+
3441
export interface IMovieAdvancedOptions {
3542
requestId: number;
3643
qualityOverride: number;

src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-advanced-options/movie-advanced-options.component.ts

+28-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, Inject, OnInit } from "@angular/core";
22
import { MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
3-
import { IAdvancedData, IRadarrProfile, IRadarrRootFolder } from "../../../../../interfaces";
3+
import { IAdvancedData, IRadarrProfile, IRadarrRootFolder, RequestCombination } from "../../../../../interfaces";
44
import { RadarrService } from "../../../../../services";
55

66
@Component({
@@ -11,6 +11,8 @@ export class MovieAdvancedOptionsComponent implements OnInit {
1111

1212
public radarrProfiles: IRadarrProfile[];
1313
public radarrRootFolders: IRadarrRootFolder[];
14+
public show4k: boolean = false;
15+
public showNormal: boolean = false;
1416

1517
constructor(public dialogRef: MatDialogRef<MovieAdvancedOptionsComponent>, @Inject(MAT_DIALOG_DATA) public data: IAdvancedData,
1618
private radarrService: RadarrService
@@ -19,16 +21,31 @@ export class MovieAdvancedOptionsComponent implements OnInit {
1921

2022

2123
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+
}
3249
}
3350

3451
private setQualityOverrides(): void {

0 commit comments

Comments
 (0)