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/databases.json
/src/Ombi/healthchecksdb /src/Ombi/healthchecksdb
/src/Ombi/ClientApp/package-lock.json /src/Ombi/ClientApp/package-lock.json
/src/Ombi.Core/Properties/launchSettings.json

@ -136,6 +136,7 @@ namespace Ombi.Core.Engine
Status = movieInfo.Status, Status = movieInfo.Status,
RequestedDate = model.Is4kRequest ? DateTime.MinValue : DateTime.Now, RequestedDate = model.Is4kRequest ? DateTime.MinValue : DateTime.Now,
Approved = false, Approved = false,
Approved4K = false,
RequestedUserId = canRequestOnBehalf ? model.RequestOnBehalf : userDetails.Id, RequestedUserId = canRequestOnBehalf ? model.RequestOnBehalf : userDetails.Id,
Background = movieInfo.BackdropPath, Background = movieInfo.BackdropPath,
LangCode = model.LanguageCode, LangCode = model.LanguageCode,
@ -151,7 +152,7 @@ namespace Ombi.Core.Engine
var usDates = movieInfo.ReleaseDates?.Results?.FirstOrDefault(x => x.IsoCode == "US"); var usDates = movieInfo.ReleaseDates?.Results?.FirstOrDefault(x => x.IsoCode == "US");
requestModel.DigitalReleaseDate = usDates?.ReleaseDate requestModel.DigitalReleaseDate = usDates?.ReleaseDate
?.FirstOrDefault(x => x.Type == ReleaseDateType.Digital)?.ReleaseDate; ?.FirstOrDefault(x => x.Type == ReleaseDateType.Digital)?.ReleaseDate;
var ruleResults = (await RunRequestRules(requestModel)).ToList(); var ruleResults = (await RunRequestRules(requestModel)).ToList();
var ruleResultInError = ruleResults.Find(x => !x.Success); var ruleResultInError = ruleResults.Find(x => !x.Success);
if (ruleResultInError != null) 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); var requestEngineResult = await AddMovieRequest(requestModel, fullMovieName, model.RequestOnBehalf, isExisting, is4kRequest);
if (requestEngineResult.Result) if (requestEngineResult.Result)
@ -333,7 +334,7 @@ namespace Ombi.Core.Engine
allRequests = allRequests.Where(x => allRequests = allRequests.Where(x =>
(x.RequestedDate != DateTime.MinValue && x.Approved && !x.Available && (!x.Denied.HasValue || !x.Denied.Value)) (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; break;
case RequestStatus.Available: case RequestStatus.Available:

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

@ -12,37 +12,41 @@
} }
}, },
"Common": { "Common": {
"ContinueButton": "Continue", "ContinueButton": "Continue",
"Available": "Available", "Available": "Available",
"Available4K": "Available 4K", "Available4K": "Available 4K",
"Approved": "Approved", "Approved": "Approved",
"Approve4K": "Approve 4K", "Approve4K": "Approve 4K",
"Pending": "Pending", "Pending": "Pending",
"PartiallyAvailable": "Partially Available", "PartiallyAvailable": "Partially Available",
"Monitored": "Monitored", "Monitored": "Monitored",
"NotAvailable": "Not Available", "NotAvailable": "Not Available",
"ProcessingRequest": "Processing Request", "ProcessingRequest": "Processing Request",
"PendingApproval": "Pending Approval", "ProcessingRequest4K": "Processing Request 4K",
"RequestDenied": "Request Denied", "PendingApproval": "Pending Approval",
"NotRequested": "Not Requested", "PendingApproval4K": "Pending Approval 4K",
"Requested": "Requested", "RequestDenied": "Request Denied",
"Requested4K": "Requested 4K", "RequestDenied4K": "Request Denied 4K",
"Search":"Search", "NotRequested": "Not Requested",
"Request": "Request", "NotRequested4K": "Not Requested 4K",
"Request4K": "Request 4K", "Requested": "Requested",
"Denied": "Denied", "Requested4K": "Requested 4K",
"Approve": "Approve", "Search": "Search",
"PartlyAvailable": "Partly Available", "Request": "Request",
"ViewDetails": "View Details", "Request4K": "Request 4K",
"Errors": { "Denied": "Denied",
"Validation": "Please check your entered values" "Approve": "Approve",
}, "PartlyAvailable": "Partly Available",
"Cancel": "Cancel", "ViewDetails": "View Details",
"Submit": "Submit", "Errors": {
"Update": "Update", "Validation": "Please check your entered values"
"tvShow": "TV Show", },
"movie": "Movie", "Cancel": "Cancel",
"album": "Album" "Submit": "Submit",
"Update": "Update",
"tvShow": "TV Show",
"movie": "Movie",
"album": "Album"
}, },
"PasswordReset": { "PasswordReset": {
"EmailAddressPlaceholder": "Email Address", "EmailAddressPlaceholder": "Email Address",
@ -341,7 +345,7 @@
"Seasons": "Seasons:", "Seasons": "Seasons:",
"Episodes": "Episodes:", "Episodes": "Episodes:",
"Availability":"Availability:", "Availability":"Availability:",
"RequestStatus":"Request Status", "RequestStatus":"Request Status:",
"Quality":"Quality:", "Quality":"Quality:",
"RootFolderOverride":"Root Folder Override:", "RootFolderOverride":"Root Folder Override:",
"QualityOverride":"Quality Override:", "QualityOverride":"Quality Override:",

Loading…
Cancel
Save