From 108d343fec6e3768306ae4b941f43bea202c6bb3 Mon Sep 17 00:00:00 2001 From: Jamie Date: Tue, 30 Jan 2018 16:01:26 +0000 Subject: [PATCH] Fixed #1878 and added a Request all button when selecting episodes --- src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs | 4 ++-- .../app/requests/movierequests.component.html | 9 ++------- .../app/search/seriesinformation.component.html | 3 ++- .../app/search/seriesinformation.component.ts | 16 +++++----------- .../ClientApp/app/search/tvsearch.component.html | 10 ++++------ 5 files changed, 15 insertions(+), 27 deletions(-) diff --git a/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs b/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs index aee7c37e4..2118e2a96 100644 --- a/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs +++ b/src/Ombi.Core/Rule/Rules/Search/ExistingRule.cs @@ -83,11 +83,11 @@ namespace Ombi.Core.Rule.Rules.Search } } - if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.All(e => e.Approved))) + if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.All(e => e.Available))) { request.FullyAvailable = true; } - if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.Any(e => e.Approved))) + if (request.SeasonRequests.Any() && request.SeasonRequests.All(x => x.Episodes.Any(e => e.Available))) { request.PartlyAvailable = true; } diff --git a/src/Ombi/ClientApp/app/requests/movierequests.component.html b/src/Ombi/ClientApp/app/requests/movierequests.component.html index c58a223cb..7b5f0b56b 100644 --- a/src/Ombi/ClientApp/app/requests/movierequests.component.html +++ b/src/Ombi/ClientApp/app/requests/movierequests.component.html @@ -2,7 +2,8 @@
- @@ -191,12 +192,6 @@
-
-
- - -
-
diff --git a/src/Ombi/ClientApp/app/search/seriesinformation.component.html b/src/Ombi/ClientApp/app/search/seriesinformation.component.html index 465563673..b5c7d5bff 100644 --- a/src/Ombi/ClientApp/app/search/seriesinformation.component.html +++ b/src/Ombi/ClientApp/app/search/seriesinformation.component.html @@ -16,7 +16,8 @@

Season: {{season.seasonNumber}}

- + + diff --git a/src/Ombi/ClientApp/app/search/seriesinformation.component.ts b/src/Ombi/ClientApp/app/search/seriesinformation.component.ts index 629961edd..74fcb4b3e 100644 --- a/src/Ombi/ClientApp/app/search/seriesinformation.component.ts +++ b/src/Ombi/ClientApp/app/search/seriesinformation.component.ts @@ -1,13 +1,11 @@ -import { Component, Input, OnDestroy, OnInit} from "@angular/core"; -import { Subject } from "rxjs/Subject"; - +import { Component, Input, OnInit} from "@angular/core"; import "rxjs/add/operator/takeUntil"; import { NotificationService } from "../services"; import { RequestService } from "../services"; import { SearchService } from "../services"; -import { IRequestEngineResult } from "../interfaces"; +import { INewSeasonRequests, IRequestEngineResult } from "../interfaces"; import { IEpisodesRequests } from "../interfaces"; import { ISearchTvResult } from "../interfaces"; @@ -16,20 +14,18 @@ import { ISearchTvResult } from "../interfaces"; templateUrl: "./seriesinformation.component.html", styleUrls: ["./seriesinformation.component.scss"], }) -export class SeriesInformationComponent implements OnInit, OnDestroy { +export class SeriesInformationComponent implements OnInit { public result: IRequestEngineResult; public series: ISearchTvResult; public requestedEpisodes: IEpisodesRequests[] = []; @Input() private seriesId: number; - private subscriptions = new Subject(); constructor(private searchService: SearchService, private requestService: RequestService, private notificationService: NotificationService) { } public ngOnInit() { this.searchService.getShowInformation(this.seriesId) - .takeUntil(this.subscriptions) .subscribe(x => { this.series = x; }); @@ -51,7 +47,6 @@ export class SeriesInformationComponent implements OnInit, OnDestroy { this.series.requested = true; this.requestService.requestTv(this.series) - .takeUntil(this.subscriptions) .subscribe(x => { this.result = x as IRequestEngineResult; if (this.result.result) { @@ -80,8 +75,7 @@ export class SeriesInformationComponent implements OnInit, OnDestroy { episode.selected = false; } - public ngOnDestroy() { - this.subscriptions.next(); - this.subscriptions.complete(); + public addAllEpisodes(season: INewSeasonRequests) { + season.episodes.forEach((ep) => this.addRequest(ep)); } } diff --git a/src/Ombi/ClientApp/app/search/tvsearch.component.html b/src/Ombi/ClientApp/app/search/tvsearch.component.html index fef73fd26..eb22dd9f6 100644 --- a/src/Ombi/ClientApp/app/search/tvsearch.component.html +++ b/src/Ombi/ClientApp/app/search/tvsearch.component.html @@ -79,12 +79,10 @@ {{node.data.network}} - - Available - - - Partially Available - + Available + + Partially Available +