|
|
|
@ -3,6 +3,7 @@ import { MatCheckboxChange } from "@angular/material/checkbox";
|
|
|
|
|
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from "@angular/material/dialog";
|
|
|
|
|
import { ISearchTvResultV2 } from "../../interfaces/ISearchTvResultV2";
|
|
|
|
|
import { MessageService } from "../../services";
|
|
|
|
|
import { TranslateService } from "@ngx-translate/core";
|
|
|
|
|
import { ISeasonsViewModel, IEpisodesRequests, INewSeasonRequests, ITvRequestViewModelV2, IRequestEngineResult, RequestType } from "../../interfaces";
|
|
|
|
|
import { RequestServiceV2 } from "../../services/requestV2.service";
|
|
|
|
|
import { AdminRequestDialogComponent } from "../admin-request-dialog/admin-request-dialog.component";
|
|
|
|
@ -23,7 +24,8 @@ export class EpisodeRequestComponent {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constructor(public dialogRef: MatDialogRef<EpisodeRequestComponent>, @Inject(MAT_DIALOG_DATA) public data: EpisodeRequestData,
|
|
|
|
|
private requestService: RequestServiceV2, private notificationService: MessageService, private dialog: MatDialog) { }
|
|
|
|
|
private requestService: RequestServiceV2, private notificationService: MessageService, private dialog: MatDialog,
|
|
|
|
|
private translate: TranslateService) { }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public async submitRequests() {
|
|
|
|
@ -35,7 +37,7 @@ export class EpisodeRequestComponent {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (!selected && !this.data.series.requestAll && !this.data.series.firstSeason && !this.data.series.latestSeason) {
|
|
|
|
|
this.notificationService.send("You need to select some episodes!", "OK");
|
|
|
|
|
this.notificationService.send(this.translate.instant("Requests.NeedToSelectEpisodes"), "OK");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -123,7 +125,7 @@ export class EpisodeRequestComponent {
|
|
|
|
|
private postRequest(requestResult: IRequestEngineResult) {
|
|
|
|
|
if (requestResult.result) {
|
|
|
|
|
this.notificationService.send(
|
|
|
|
|
`Request for ${this.data.series.title} has been added successfully`);
|
|
|
|
|
this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.data.series.title }));
|
|
|
|
|
|
|
|
|
|
this.data.series.seasonRequests.forEach((season) => {
|
|
|
|
|
season.episodes.forEach((ep) => {
|
|
|
|
|