Skip to content

Commit

Permalink
Partially Available prevents further TV requests (Ombi-app#4768)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wesley King committed Oct 15, 2022
1 parent 5446406 commit 66bc592
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ <h3> {{ 'MediaDetails.NotEnoughInfo' | translate }}</h3>
<i class="far fa-play-circle fa-2x"></i>
</a>
</ng-container>
<button *ngIf="!tv.fullyAvailable && !allEpisodesRequested()" mat-raised-button id="requestBtn" class="btn-spacing" color="primary"
(click)="request()"><i class="fas fa-plus"></i>
<button *ngIf="(!tv.fullyAvailable || (tv.fullyAvailable && tv.partlyAvailable)) && !allEpisodesRequestedOrAvailable()" mat-raised-button id="requestBtn" class="btn-spacing" color="primary"
(click)="request()"><i class="fas fa-plus"></i>
{{ 'Common.Request' | translate }}</button>

<button *ngIf="!tv.denied && allEpisodesRequested()" mat-raised-button class="btn-spacing" color="warn" [disabled]>
<button *ngIf="!tv.denied && allEpisodesRequestedOrAvailable()" mat-raised-button class="btn-spacing" color="warn" [disabled]>
<i class="fas fa-check"></i>
{{ 'Common.Requested' | translate }}</button>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,10 @@ export class TvDetailsComponent implements OnInit {
}
}

public allEpisodesRequested(): boolean {
return this.tv.seasonRequests.every(e => e.episodes.every(x => x.approved || x.requested));
public allEpisodesRequestedOrAvailable(): boolean {
return this.tv.seasonRequests.every(e => e.episodes.every(x => x.available || x.approved || x.requested));
}

private checkPoster() {
if (this.tv.images.original == null) {
this.tv.images.original = "../../../images/default_movie_poster.png";
Expand Down

0 comments on commit 66bc592

Please sign in to comment.