feat(details): Added the notify button back into the details pages for requests

pull/4449/head
tidusjar 3 years ago
parent 9fe1f8e988
commit 8b33cdccef

@ -72,6 +72,12 @@
{{'Common.Request' | translate }} {{'Common.Request' | translate }}
</button> </button>
</ng-template> </ng-template>
<span *ngIf="!isAdmin && movie.showSubscribe" >
<button *ngIf="!movie.subscribed" (click)="notify()" id="notifyBtn" mat-raised-button class="btn-spacing" > <i class="fas fa-bell"></i>
{{ 'Requests.Notify' | translate }}</button>
<button *ngIf="movie.subscribed" (click)="unNotify()" id="unnotifyBtn" mat-raised-button class="btn-spacing" > <i class="fas fa-bell-slash"></i>
{{ 'Requests.RemoveNotification' | translate }}</button>
</span>
</span> </span>
<span *ngIf="isAdmin && hasRequest"> <span *ngIf="isAdmin && hasRequest">
<button id="approveBtn" *ngIf="!movie.approved " (click)="approve()" mat-raised-button class="btn-spacing" color="accent"> <button id="approveBtn" *ngIf="!movie.approved " (click)="approve()" mat-raised-button class="btn-spacing" color="accent">

@ -213,6 +213,28 @@ export class MovieDetailsComponent {
}); });
} }
public notify() {
this.requestService.subscribeToMovie(this.movieRequest.id).subscribe(result => {
if (result) {
this.movie.subscribed = true;
this.messageService.send(this.translate.instant("Requests.SuccessfulNotify", {title: this.movie.title}), "Ok");
} else {
this.messageService.send(this.translate.instant("Requests.CouldntNotify", {title: this.movie.title}), "Ok");
}
});
}
public unNotify() {
this.requestService.unSubscribeToMovie(this.movieRequest.id).subscribe(result => {
if (result) {
this.movie.subscribed = false;
this.messageService.send(this.translate.instant("Requests.SuccessfulUnNotify", {title: this.movie.title}), "Ok");
} else {
this.messageService.send(this.translate.instant("Requests.CouldntNotify", {title: this.movie.title}), "Ok");
}
});
}
private loadBanner() { private loadBanner() {
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => { this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
if (!this.movie.backdropPath) { if (!this.movie.backdropPath) {

@ -226,7 +226,12 @@
"MovieRequestQuotaExceeded":"You have exceeded your Movie request quota!", "MovieRequestQuotaExceeded":"You have exceeded your Movie request quota!",
"TvRequestQuotaExceeded":"You have exceeded your Episode request quota!", "TvRequestQuotaExceeded":"You have exceeded your Episode request quota!",
"AlbumRequestQuotaExceeded":"You have exceeded your Album request quota!" "AlbumRequestQuotaExceeded":"You have exceeded your Album request quota!"
} },
"Notify": "Notify",
"RemoveNotification": "Remove Notifications",
"SuccessfulNotify":"You will now be notified for title {{title}}",
"SuccessfulUnNotify":"You will no longer be notified for title {{title}}",
"CouldntNotify":"Couldn't notify title {{title}}"
}, },
"Issues": { "Issues": {
"Title": "Issues", "Title": "Issues",

Loading…
Cancel
Save