fix: Fix denied movie shown as 'processing request' in details view (#4900)

pull/4907/head
sephrat 2 years ago committed by GitHub
parent 1e87f20104
commit 0069bfdf54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -36,18 +36,7 @@
</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.denied && 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.denied4K && movie.requested4K && !movie.approved4K && !movie.available4K">{{'Common.PendingApproval4K' | translate}}</div>
<!--<div *ngIf="!movie.requested4K && !movie.available4K && !movie.approved4K">{{'Common.NotRequested4K' | translate}}</div>-->
</div>
<div>{{getStatus(movie) | translate}}</div>
</div>
<div *ngIf="request">

@ -34,4 +34,28 @@ export class MovieInformationPanelComponent implements OnInit {
this.searchService.getMovieStreams(this.movie.id).subscribe(x => this.streams = x);
}
public getStatus(movie: ISearchMovieResultV2) {
if (!movie.available && movie.requested) {
if (movie.denied) {
return "Common.RequestDenied";
}
if (movie.approved) {
return "Common.ProcessingRequest";
} else {
return "Common.PendingApproval";
}
}
if (!movie.available4K && movie.has4KRequest) {
if (movie.denied4K) {
return "Common.RequestDenied4K";
}
if (movie.approved4K) {
return "Common.ProcessingRequest4K";
} else {
return "Common.PendingApproval4K";
}
}
}
}

Loading…
Cancel
Save