mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-12 00:06:05 -07:00
Simplified the loading
This commit is contained in:
parent
78af64446b
commit
0547c55855
1 changed files with 2 additions and 32 deletions
|
@ -162,38 +162,8 @@ export class DiscoverComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
private createInitialModel() {
|
private createInitialModel() {
|
||||||
this.movies.forEach(m => {
|
this.clear();
|
||||||
this.discoverResults.push({
|
this.createModel();
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private shuffle(discover: IDiscoverCardResult[]): IDiscoverCardResult[] {
|
private shuffle(discover: IDiscoverCardResult[]): IDiscoverCardResult[] {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue