Skip to content

Commit

Permalink
fix(availability-rules): 🐛 Show the 'Requested' button when a show ha…
Browse files Browse the repository at this point in the history
…s all of the episodes marked as requested
  • Loading branch information
tidusjar committed Dec 17, 2021
1 parent de957b4 commit cb7ecf6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,14 @@ <h3> {{ 'MediaDetails.NotEnoughInfo' | translate }}</h3>
<i class="far fa-play-circle fa-2x"></i>
</a>
</ng-container>
<button *ngIf="!tv.fullyAvailable" mat-raised-button id="requestBtn" class="btn-spacing" color="primary"
<button *ngIf="!tv.fullyAvailable && !allEpisodesRequested()" mat-raised-button id="requestBtn" class="btn-spacing" color="primary"
(click)="request()"><i class="fas fa-plus"></i>
{{ 'Common.Request' | translate }}</button>

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

<button *ngIf="tv.fullyAvailable && !tv.partlyAvailable" id="availableBtn" mat-raised-button class="btn-spacing" color="accent"
[disabled]>
<i class="fas fa-check"></i> {{'Common.Available' | translate }}</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ export class TvDetailsComponent implements OnInit {
}
}

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

private loadAdvancedInfo() {
const profile = this.sonarrService.getQualityProfilesWithoutSettings();
const folders = this.sonarrService.getRootFoldersWithoutSettings();
Expand Down

0 comments on commit cb7ecf6

Please sign in to comment.