From 6e7e1e466080c56886d8535a237e8086abd4ad4c Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Tue, 26 Sep 2017 14:14:04 +0100 Subject: [PATCH] #1513 !wip when we request episodes then it will show as pending approval if the request was successful --- src/Ombi/ClientApp/app/interfaces/ISearchTvResult.ts | 4 ++-- .../app/search/seriesinformation.component.ts | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Ombi/ClientApp/app/interfaces/ISearchTvResult.ts b/src/Ombi/ClientApp/app/interfaces/ISearchTvResult.ts index e4895da1d..5ed9567f5 100644 --- a/src/Ombi/ClientApp/app/interfaces/ISearchTvResult.ts +++ b/src/Ombi/ClientApp/app/interfaces/ISearchTvResult.ts @@ -1,4 +1,4 @@ -import { ISeasonRequests } from "./IRequestModel"; +import { INewSeasonRequests } from "./IRequestModel"; export interface ISearchTvResult { id: number; @@ -21,7 +21,7 @@ export interface ISearchTvResult { siteRating: number; trailer: string; homepage: string; - seasonsRequests: ISeasonRequests[]; + seasonRequests: INewSeasonRequests[]; requestAll: boolean; approved: boolean; requested: boolean; diff --git a/src/Ombi/ClientApp/app/search/seriesinformation.component.ts b/src/Ombi/ClientApp/app/search/seriesinformation.component.ts index 4b68ba305..c8857bac8 100644 --- a/src/Ombi/ClientApp/app/search/seriesinformation.component.ts +++ b/src/Ombi/ClientApp/app/search/seriesinformation.component.ts @@ -42,12 +42,20 @@ export class SeriesInformationComponent implements OnInit, OnDestroy { this.requestService.requestTv(this.series) .takeUntil(this.subscriptions) .subscribe(x => { + debugger; this.result = x as IRequestEngineResult; if (this.result.requestAdded) { this.notificationService.success("Request Added", `Request for ${this.series.title} has been added successfully`); + + this.series.seasonRequests.forEach((season) => { + season.episodes.forEach((ep) => { + ep.selected = false; + }); + }); + } else { - this.notificationService.warning("Request Added", this.result.message); + this.notificationService.warning("Request Added", this.result.errorMessage ? this.result.errorMessage : this.result.message); } }); }