From 0547c5585510b290dbdfb7c090fe19d384acf11f Mon Sep 17 00:00:00 2001 From: Jamie Rees Date: Mon, 2 Dec 2019 14:18:58 +0000 Subject: [PATCH] Simplified the loading --- .../components/discover/discover.component.ts | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.ts b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.ts index 27b8c2724..9dc3c066d 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/discover/discover.component.ts @@ -162,38 +162,8 @@ export class DiscoverComponent implements OnInit { } private createInitialModel() { - this.movies.forEach(m => { - this.discoverResults.push({ - available: m.available, - posterPath: `https://image.tmdb.org/t/p/w300/${m.posterPath}`, - requested: m.requested, - title: m.title, - type: RequestType.movie, - id: m.id, - url: `http://www.imdb.com/title/${m.imdbId}/`, - rating: m.voteAverage, - overview: m.overview, - approved: m.approved, - imdbid: m.imdbId - }); - }); - this.tvShows.forEach(m => { - this.discoverResults.push({ - available: m.available, - posterPath: "../../../images/default_tv_poster.png", - requested: m.requested, - title: m.title, - type: RequestType.tvShow, - id: m.id, - url: undefined, - rating: +m.rating, - overview: m.overview, - approved: m.approved, - imdbid: m.imdbId - }); - }); - this.shuffle(this.discoverResults); - this.finishLoading(); + this.clear(); + this.createModel(); } private shuffle(discover: IDiscoverCardResult[]): IDiscoverCardResult[] {