From 7362446832e2882270ed05fb147a66befc707742 Mon Sep 17 00:00:00 2001 From: Florian Dupret <34862846+sephrat@users.noreply.github.com> Date: Tue, 9 Nov 2021 17:48:10 +0100 Subject: [PATCH] Remove user filter from discover actor page --- .../actor/discover-actor.component.ts | 42 +++++-------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/discover/components/actor/discover-actor.component.ts b/src/Ombi/ClientApp/src/app/discover/components/actor/discover-actor.component.ts index 559fb3be2..d170a11ca 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/actor/discover-actor.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/actor/discover-actor.component.ts @@ -5,8 +5,6 @@ import { IActorCredits, IActorCast } from "../../../interfaces/ISearchTvResultV2 import { IDiscoverCardResult } from "../../interfaces"; import { RequestType } from "../../../interfaces"; import { AuthService } from "../../../auth/auth.service"; -import { FilterService } from "../../services/filter-service"; -import { SearchFilter } from "../../../my-nav/SearchFilter"; import { forkJoin } from "rxjs"; import { isEqual } from "lodash"; @@ -20,14 +18,10 @@ export class DiscoverActorComponent { public isAdmin: boolean; public discoverResults: IDiscoverCardResult[] = []; - public filter: SearchFilter; constructor(private searchService: SearchV2Service, private route: ActivatedRoute, - private filterService: FilterService, private auth: AuthService) { - - this.filter = this.filterService.filter; this.route.params.subscribe((params: any) => { this.actorId = params.actorId; this.isAdmin = this.auth.isAdmin(); @@ -35,39 +29,23 @@ export class DiscoverActorComponent { }); } - public async ngOnInit() { - this.filterService.onFilterChange.subscribe(async x => { - if (!isEqual(this.filter, x)) { - this.filter = { ...x }; - await this.search(); - } - }); - } - private search() { this.discoverResults = []; this.loading(); var searches = []; - if (this.filter.movies) { - var moviesSearch = this.searchService.getMoviesByActor(this.actorId); - moviesSearch.subscribe(res => { - this.pushDiscoverResults(res.cast, RequestType.movie); - }); - searches.push(moviesSearch); - } + var moviesSearch = this.searchService.getMoviesByActor(this.actorId); + moviesSearch.subscribe(res => { + this.pushDiscoverResults(res.cast, RequestType.movie); + }); + searches.push(moviesSearch); - if (this.filter.tvShows) { - var TvSearch = this.searchService.getTvByActor(this.actorId); - TvSearch.subscribe(res => { - this.pushDiscoverResults(res.cast, RequestType.tvShow); - }); - searches.push(TvSearch); - } + var TvSearch = this.searchService.getTvByActor(this.actorId); + TvSearch.subscribe(res => { + this.pushDiscoverResults(res.cast, RequestType.tvShow); + }); + searches.push(TvSearch); - if (searches.length === 0) { - this.finishLoading(); - } forkJoin(searches).subscribe(() => { this.finishLoading(); });