mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-21 05:43:19 -07:00
feat(details): ✨ Added the notify button back into the details pages for requests
This commit is contained in:
parent
9fe1f8e988
commit
8b33cdccef
3 changed files with 34 additions and 1 deletions
|
@ -72,6 +72,12 @@
|
|||
{{'Common.Request' | translate }}
|
||||
</button>
|
||||
</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 *ngIf="isAdmin && hasRequest">
|
||||
<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() {
|
||||
this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
|
||||
if (!this.movie.backdropPath) {
|
||||
|
|
|
@ -226,7 +226,12 @@
|
|||
"MovieRequestQuotaExceeded":"You have exceeded your Movie request quota!",
|
||||
"TvRequestQuotaExceeded":"You have exceeded your Episode 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": {
|
||||
"Title": "Issues",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue