From c35c9c4ad051ddae7c82ca54d3075c662e79ad44 Mon Sep 17 00:00:00 2001 From: Lucane Date: Mon, 25 Jul 2022 01:36:56 +0300 Subject: [PATCH 1/4] GetRequestsByStatus wasn't implementing the MovieRequests object correctly for 4K quality requests with the ProcessingRequest status. --- src/Ombi.Core/Engine/MovieRequestEngine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index 9403fdcae..4f090c041 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -333,7 +333,7 @@ public async Task> GetRequestsByStatus(int coun allRequests = allRequests.Where(x => (x.RequestedDate != DateTime.MinValue && x.Approved && !x.Available && (!x.Denied.HasValue || !x.Denied.Value)) || - (x.Has4KRequest && x.Approved4K && !x.Available && (!x.Denied.HasValue || !x.Denied.Value)) + (x.Has4KRequest && x.Approved4K && !x.Available4K && (!x.Denied4K.HasValue || !x.Denied4K.Value)) ); break; case RequestStatus.Available: From d48e848a59551228245928c06dc42e23c87fd45d Mon Sep 17 00:00:00 2001 From: Lucane Date: Tue, 26 Jul 2022 07:52:40 +0300 Subject: [PATCH 2/4] Fixed 4K requests not getting automatically approved if the user has the "Auto Approve Movie" role flag enabled. --- .gitignore | 1 + src/Ombi.Core/Engine/MovieRequestEngine.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 845eda385..cae15017a 100644 --- a/.gitignore +++ b/.gitignore @@ -251,3 +251,4 @@ _Pvt_Extensions /src/Ombi/databases.json /src/Ombi/healthchecksdb /src/Ombi/ClientApp/package-lock.json +/src/Ombi.Core/Properties/launchSettings.json diff --git a/src/Ombi.Core/Engine/MovieRequestEngine.cs b/src/Ombi.Core/Engine/MovieRequestEngine.cs index 4f090c041..e5114677b 100644 --- a/src/Ombi.Core/Engine/MovieRequestEngine.cs +++ b/src/Ombi.Core/Engine/MovieRequestEngine.cs @@ -136,6 +136,7 @@ public async Task RequestMovie(MovieRequestViewModel model) Status = movieInfo.Status, RequestedDate = model.Is4kRequest ? DateTime.MinValue : DateTime.Now, Approved = false, + Approved4K = false, RequestedUserId = canRequestOnBehalf ? model.RequestOnBehalf : userDetails.Id, Background = movieInfo.BackdropPath, LangCode = model.LanguageCode, @@ -151,7 +152,7 @@ public async Task RequestMovie(MovieRequestViewModel model) var usDates = movieInfo.ReleaseDates?.Results?.FirstOrDefault(x => x.IsoCode == "US"); requestModel.DigitalReleaseDate = usDates?.ReleaseDate ?.FirstOrDefault(x => x.Type == ReleaseDateType.Digital)?.ReleaseDate; - + var ruleResults = (await RunRequestRules(requestModel)).ToList(); var ruleResultInError = ruleResults.Find(x => !x.Success); if (ruleResultInError != null) @@ -163,7 +164,7 @@ public async Task RequestMovie(MovieRequestViewModel model) }; } - if (requestModel.Approved) // The rules have auto approved this + if (requestModel.Approved || requestModel.Approved4K) // The rules have auto approved this { var requestEngineResult = await AddMovieRequest(requestModel, fullMovieName, model.RequestOnBehalf, isExisting, is4kRequest); if (requestEngineResult.Result) From 2c57b3033c721c14185d972f682fa992319bc248 Mon Sep 17 00:00:00 2001 From: Lucane Date: Tue, 26 Jul 2022 21:07:22 +0300 Subject: [PATCH 3/4] Fixed "Request Date" values for the "left-panel-details" div class. Previously when the movie was exclusively 4K (regular request was absent), then "Request Date" equaled DateTime.MinValue (January 1, 0001). --- .../movie/panels/movie-information-panel.component.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 7fd3ce0ea..287a7a1fb 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -50,8 +50,9 @@
- {{'MediaDetails.RequestDate' | translate }} - {{request.requestedDate | amUserLocale | amDateFormat: 'LL'}} + {{'MediaDetails.RequestDate' | translate }} + {{request.requestedDate4k | amUserLocale | amDateFormat: 'LL'}} + {{request.requestedDate | amUserLocale | amDateFormat: 'LL'}}
From da1cfa2edc116db9a033368aacd462ebf8ede4b8 Mon Sep 17 00:00:00 2001 From: Lucane Date: Tue, 26 Jul 2022 21:24:53 +0300 Subject: [PATCH 4/4] Fixed "Request Status" evaluation in the "left-panel-details" div class. Now it shows the appropriate status instead of an empty spot. "Request Status" displays both regular and 4K statuses at the same time if needed. Added a comma to the end of the "RequestStatus" label to maintain design consistency with the other labels. Also added a "Denied Reason" element for 4K requests. --- .../movie-information-panel.component.html | 45 +++++++----- src/Ombi/wwwroot/translations/en.json | 68 ++++++++++--------- 2 files changed, 64 insertions(+), 49 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 287a7a1fb..29d2c6beb 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -30,23 +30,29 @@ {{ this.movie.status | translateStatus }}
- {{'MediaDetails.Availability' | translate }} - {{'Common.Available' | translate}} - {{'Common.NotAvailable' | translate}} -
-
- {{'MediaDetails.RequestStatus' | translate }} -
{{'Common.Denied' | translate}}
-
{{'Common.ProcessingRequest' | translate}}
-
{{'Common.PendingApproval' | translate}} -
-
{{'Common.NotRequested' | translate}} -
+ {{'MediaDetails.Availability' | translate }} + {{'Common.Available' | translate}} + {{'Common.NotAvailable' | translate}} +
+
+ {{'MediaDetails.RequestStatus' | translate }} +
+
{{'Common.RequestDenied' | translate}}
+
{{'Common.ProcessingRequest' | translate}}
+
{{'Common.PendingApproval' | translate}}
+ +
+
+
{{'Common.RequestDenied4K' | translate}}
+
{{'Common.ProcessingRequest4K' | translate}}
+
{{'Common.PendingApproval4K' | translate}}
+ +
- {{'MediaDetails.RequestedBy' | translate }} - {{request.requestedUser.userAlias}} + {{'MediaDetails.RequestedBy' | translate }} + {{request.requestedUser.userAlias}}
@@ -60,9 +66,14 @@ {{RequestSource[request.source]}}
-
- {{'MediaDetails.DeniedReason' | translate }} +
+ {{'MediaDetails.DeniedReason' | translate }} +
{{request.deniedReason}} +
+
+ {{request.deniedReason4K}} +
@@ -73,7 +84,7 @@
{{'MediaDetails.Quality' | translate }}  - {{"4K" | quality}} + {{"4K" | quality}}
diff --git a/src/Ombi/wwwroot/translations/en.json b/src/Ombi/wwwroot/translations/en.json index 3611b0249..de38effd3 100644 --- a/src/Ombi/wwwroot/translations/en.json +++ b/src/Ombi/wwwroot/translations/en.json @@ -12,37 +12,41 @@ } }, "Common": { - "ContinueButton": "Continue", - "Available": "Available", - "Available4K": "Available 4K", - "Approved": "Approved", - "Approve4K": "Approve 4K", - "Pending": "Pending", - "PartiallyAvailable": "Partially Available", - "Monitored": "Monitored", - "NotAvailable": "Not Available", - "ProcessingRequest": "Processing Request", - "PendingApproval": "Pending Approval", - "RequestDenied": "Request Denied", - "NotRequested": "Not Requested", - "Requested": "Requested", - "Requested4K": "Requested 4K", - "Search":"Search", - "Request": "Request", - "Request4K": "Request 4K", - "Denied": "Denied", - "Approve": "Approve", - "PartlyAvailable": "Partly Available", - "ViewDetails": "View Details", - "Errors": { - "Validation": "Please check your entered values" - }, - "Cancel": "Cancel", - "Submit": "Submit", - "Update": "Update", - "tvShow": "TV Show", - "movie": "Movie", - "album": "Album" + "ContinueButton": "Continue", + "Available": "Available", + "Available4K": "Available 4K", + "Approved": "Approved", + "Approve4K": "Approve 4K", + "Pending": "Pending", + "PartiallyAvailable": "Partially Available", + "Monitored": "Monitored", + "NotAvailable": "Not Available", + "ProcessingRequest": "Processing Request", + "ProcessingRequest4K": "Processing Request 4K", + "PendingApproval": "Pending Approval", + "PendingApproval4K": "Pending Approval 4K", + "RequestDenied": "Request Denied", + "RequestDenied4K": "Request Denied 4K", + "NotRequested": "Not Requested", + "NotRequested4K": "Not Requested 4K", + "Requested": "Requested", + "Requested4K": "Requested 4K", + "Search": "Search", + "Request": "Request", + "Request4K": "Request 4K", + "Denied": "Denied", + "Approve": "Approve", + "PartlyAvailable": "Partly Available", + "ViewDetails": "View Details", + "Errors": { + "Validation": "Please check your entered values" + }, + "Cancel": "Cancel", + "Submit": "Submit", + "Update": "Update", + "tvShow": "TV Show", + "movie": "Movie", + "album": "Album" }, "PasswordReset": { "EmailAddressPlaceholder": "Email Address", @@ -341,7 +345,7 @@ "Seasons": "Seasons:", "Episodes": "Episodes:", "Availability":"Availability:", - "RequestStatus":"Request Status", + "RequestStatus":"Request Status:", "Quality":"Quality:", "RootFolderOverride":"Root Folder Override:", "QualityOverride":"Quality Override:",