fix(availability-rules): 🐛 Show the 'Requested' button when a show has all of the episodes marked as requested

merge-music
tidusjar 3 years ago
parent de957b401f
commit cb7ecf684a

@ -61,10 +61,14 @@
<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>

@ -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();

Loading…
Cancel
Save