fix(4K) :4K request fixes (#4702)

* GetRequestsByStatus wasn't implementing the MovieRequests object correctly for 4K quality requests with the ProcessingRequest status.

* Fixed 4K requests not getting automatically approved if the user has the "Auto Approve Movie" role flag enabled.

* 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).

* 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.
pull/4706/head
Lucane 2 years ago committed by GitHub
parent 875da959f3
commit 7fd9178f53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

1
.gitignore vendored

@ -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

@ -136,6 +136,7 @@ namespace Ombi.Core.Engine
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 @@ namespace Ombi.Core.Engine
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 @@ namespace Ombi.Core.Engine
};
}
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)
@ -333,7 +334,7 @@ namespace Ombi.Core.Engine
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:

@ -30,28 +30,35 @@
<span id="status"> {{ this.movie.status | translateStatus }}</span>
</div>
<div>
<span class="label">{{'MediaDetails.Availability' | translate }}</span>
<span *ngIf="movie.available"> {{'Common.Available' | translate}}</span>
<span *ngIf="!movie.available"> {{'Common.NotAvailable' | translate}}</span>
</div>
<div *ngIf="!movie.available">
<span class="label">{{'MediaDetails.RequestStatus' | translate }}</span>
<div *ngIf="movie.denied">{{'Common.Denied' | translate}}</div>
<div *ngElseIf="movie.approved && !movie.available">{{'Common.ProcessingRequest' | translate}}</div>
<div *ngElseIf="movie.requested && !movie.approved && !movie.available">{{'Common.PendingApproval' | translate}}
</div>
<div *ngElseIf="!movie.requested && !movie.available && !movie.approved">{{'Common.NotRequested' | translate}}
</div>
<span class="label">{{'MediaDetails.Availability' | translate }}</span>
<span *ngIf="movie.available || movie.available4K"> {{'Common.Available' | translate}}</span>
<span *ngIf="!movie.available && !movie.available4K"> {{'Common.NotAvailable' | translate}}</span>
</div>
<div *ngIf="(!movie.available && movie.requested) || (!movie.available4K && movie.has4KRequest)">
<span class="label">{{'MediaDetails.RequestStatus' | translate }}</span>
<div *ngIf="!movie.available && movie.requested">
<div *ngIf="movie.denied">{{'Common.RequestDenied' | translate}}</div>
<div *ngIf="movie.approved && !movie.available">{{'Common.ProcessingRequest' | translate}}</div>
<div *ngIf="movie.requested && !movie.approved">{{'Common.PendingApproval' | translate}}</div>
<!--<div *ngIf="!movie.requested && !movie.available && !movie.approved">{{'Common.NotRequested' | translate}}</div>-->
</div>
<div *ngIf="!movie.available4K && movie.has4KRequest">
<div *ngIf="movie.denied4K">{{'Common.RequestDenied4K' | translate}}</div>
<div *ngIf="movie.approved4K && !movie.available4K">{{'Common.ProcessingRequest4K' | translate}}</div>
<div *ngIf="movie.requested4K && !movie.approved4K && !movie.available4K">{{'Common.PendingApproval4K' | translate}}</div>
<!--<div *ngIf="!movie.requested4K && !movie.available4K && !movie.approved4K">{{'Common.NotRequested4K' | translate}}</div>-->
</div>
</div>
<div *ngIf="request">
<span class="label">{{'MediaDetails.RequestedBy' | translate }}</span>
<span id="requestedByInfo"> {{request.requestedUser.userAlias}}</span>
<span class="label">{{'MediaDetails.RequestedBy' | translate }}</span>
<span id="requestedByInfo"> {{request.requestedUser.userAlias}}</span>
</div>
<div *ngIf="request">
<span class="label">{{'MediaDetails.RequestDate' | translate }}</span>
{{request.requestedDate | amUserLocale | amDateFormat: 'LL'}}
<span class="label">{{'MediaDetails.RequestDate' | translate }}</span>
<span *ngIf="request.requestedDate < request.requestedDate4k"> {{request.requestedDate4k | amUserLocale | amDateFormat: 'LL'}}</span>
<span *ngIf="request.requestedDate > request.requestedDate4k"> {{request.requestedDate | amUserLocale | amDateFormat: 'LL'}}</span>
</div>
<div *ngIf="request && request.source !== RequestSource.Ombi">
@ -59,9 +66,14 @@
{{RequestSource[request.source]}}
</div>
<div *ngIf="request && request.denied">
<span class="label">{{'MediaDetails.DeniedReason' | translate }}</span>
<div *ngIf="request">
<span class="label">{{'MediaDetails.DeniedReason' | translate }}</span>
<div *ngIf="request.denied">
<span id="deniedReasonInfo">{{request.deniedReason}}</span>
</div>
<div *ngIf="request.denied4K">
<span id="deniedReasonInfo4K">{{request.deniedReason4K}}</span>
</div>
</div>
@ -72,7 +84,7 @@
<div *ngIf="movie.available4K">
<span class="label">{{'MediaDetails.Quality' | translate }}&nbsp;</span>
<span >{{"4K" | quality}}</span>
<span>{{"4K" | quality}}</span>
</div>
<div *ngIf="advancedOptions && request && request.rootPathOverrideTitle">

@ -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:",

Loading…
Cancel
Save