fix(discover): 🐛 Fixed the issue where there was an option on the discover to request 4k shows (that's not supported currently)

pull/4532/head
tidusjar 3 years ago
parent 19fe4e342e
commit dcfd688c8d

@ -20,24 +20,32 @@
</a> </a>
</div> </div>
<div [ngClass]="result.posterPath.includes('images/') ? 'button-request-container-show' : 'button-request-container'" class="row" *ngIf="!result.available && !result.approved && !result.requested"> <div [ngClass]="result.posterPath.includes('images/') ? 'button-request-container-show' : 'button-request-container'" class="row" *ngIf="!result.available && !result.approved && !result.requested">
<div *ngIf="!is4kEnabled" class="button-request poster-overlay">
<button id="requestButton{{result.id}}{{result.type}}{{discoverType}}" *ngIf="requestable" mat-raised-button class="btn-ombi full-width poster-request-btn" (click)="request($event, false)"> <div *ngIf="is4kEnabled && requestable && result.type === RequestType.movie;then show4K else regular"></div>
<i *ngIf="!loading" class="fa-lg fas fa-cloud-download-alt"></i> <ng-template #show4K>
<i *ngIf="loading" class="fas fa-spinner fa-pulse fa-2x fa-fw" aria-hidden="true"></i> <div class="button-request poster-overlay">
{{'Common.Request' | translate }} <button [matMenuTriggerFor]="menu" id="requestButton{{result.id}}{{result.type}}{{discoverType}}" mat-raised-button class="btn-ombi full-width poster-request-btn">
</button> <i *ngIf="!loading" class="fa-lg fas fa-cloud-download-alt"></i>
</div> <i *ngIf="loading" class="fas fa-spinner fa-pulse fa-2x fa-fw" aria-hidden="true"></i>
<div *ngIf="is4kEnabled && requestable" class="button-request poster-overlay"> {{'Common.Request' | translate }}
<button [matMenuTriggerFor]="menu" id="requestButton{{result.id}}{{result.type}}{{discoverType}}" mat-raised-button class="btn-ombi full-width poster-request-btn"> </button>
<i *ngIf="!loading" class="fa-lg fas fa-cloud-download-alt"></i> <mat-menu #menu="matMenu">
<i *ngIf="loading" class="fas fa-spinner fa-pulse fa-2x fa-fw" aria-hidden="true"></i> <button mat-menu-item class="btn-ombi full-width poster-request-btn" (click)="request($event, false)">{{'Common.Request' | translate }}</button>
{{'Common.Request' | translate }} <button mat-menu-item class="btn-ombi full-width poster-request-btn" (click)="request($event, true)">{{'Common.Request4K' | translate }}</button>
</button> </mat-menu>
<mat-menu #menu="matMenu"> </div>
<button mat-menu-item class="btn-ombi full-width poster-request-btn" (click)="request($event, false)">{{'Common.Request' | translate }}</button> </ng-template>
<button mat-menu-item class="btn-ombi full-width poster-request-btn" (click)="request($event, true)">{{'Common.Request4K' | translate }}</button> <ng-template #regular>
</mat-menu> <div class="button-request poster-overlay">
</div> <button id="requestButton{{result.id}}{{result.type}}{{discoverType}}" *ngIf="requestable" mat-raised-button class="btn-ombi full-width poster-request-btn" (click)="request($event, false)">
<i *ngIf="!loading" class="fa-lg fas fa-cloud-download-alt"></i>
<i *ngIf="loading" class="fas fa-spinner fa-pulse fa-2x fa-fw" aria-hidden="true"></i>
{{'Common.Request' | translate }}
</button>
</div>
</ng-template>
</div> </div>
</div> </div>

@ -26,6 +26,7 @@ export class DiscoverCardComponent implements OnInit {
public hide: boolean; public hide: boolean;
public fullyLoaded = false; public fullyLoaded = false;
public loading: boolean; public loading: boolean;
public allow4KButton: boolean = false;
public requestable: boolean; public requestable: boolean;
@ -41,6 +42,7 @@ export class DiscoverCardComponent implements OnInit {
this.getExtraTvInfo(); this.getExtraTvInfo();
} }
if (this.result.type == RequestType.movie) { if (this.result.type == RequestType.movie) {
this.allow4KButton = true;
this.getExtraMovieInfo(); this.getExtraMovieInfo();
} }
if (this.result.type == RequestType.album) { if (this.result.type == RequestType.album) {
@ -169,9 +171,9 @@ export class DiscoverCardComponent implements OnInit {
private updateMovieItem(updated: ISearchMovieResultV2) { private updateMovieItem(updated: ISearchMovieResultV2) {
this.result.url = "http://www.imdb.com/title/" + updated.imdbId + "/"; this.result.url = "http://www.imdb.com/title/" + updated.imdbId + "/";
this.result.available = updated.available; this.result.available = updated.available || updated.available4K;
this.result.requested = updated.requested; this.result.requested = updated.requested || updated.has4KRequest;
this.result.approved = updated.approved; this.result.approved = updated.approved || updated.available4K;
this.result.rating = updated.voteAverage; this.result.rating = updated.voteAverage;
this.result.overview = updated.overview; this.result.overview = updated.overview;
this.result.imdbid = updated.imdbId; this.result.imdbid = updated.imdbId;

Loading…
Cancel
Save