increased the load on discover

pull/3554/head
Jamie Rees 5 years ago
parent 0308d784e7
commit 5a4c7d7893

@ -35,6 +35,8 @@ export class DiscoverComponent implements OnInit {
public loadingFlag: boolean;
public scrollDisabled: boolean;
private amountToLoad = 14;
private contentLoaded: number;
private isScrolling: boolean = false;
private mediaTypeStorageKey = "DiscoverOptions";
@ -51,14 +53,14 @@ export class DiscoverComponent implements OnInit {
this.scrollDisabled = true;
switch (this.discoverOptions) {
case DiscoverOption.Combined:
this.movies = await this.searchService.popularMoviesByPage(0, 12);
this.tvShows = await this.searchService.popularTvByPage(0, 12);
this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad);
this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad);
break;
case DiscoverOption.Movie:
this.movies = await this.searchService.popularMoviesByPage(0, 12);
this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad);
break;
case DiscoverOption.Tv:
this.tvShows = await this.searchService.popularTvByPage(0, 12);
this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad);
break;
}
@ -78,42 +80,42 @@ export class DiscoverComponent implements OnInit {
if (this.popularActive) {
switch (this.discoverOptions) {
case DiscoverOption.Combined:
this.movies = await this.searchService.popularMoviesByPage(this.contentLoaded, 12);
this.tvShows = await this.searchService.popularTvByPage(this.contentLoaded, 12);
this.movies = await this.searchService.popularMoviesByPage(this.contentLoaded, this.amountToLoad);
this.tvShows = await this.searchService.popularTvByPage(this.contentLoaded, this.amountToLoad);
break;
case DiscoverOption.Movie:
this.movies = await this.searchService.popularMoviesByPage(this.contentLoaded, 12);
this.movies = await this.searchService.popularMoviesByPage(this.contentLoaded, this.amountToLoad);
break;
case DiscoverOption.Tv:
this.tvShows = await this.searchService.popularTvByPage(this.contentLoaded, 12);
this.tvShows = await this.searchService.popularTvByPage(this.contentLoaded, this.amountToLoad);
break;
}
}
if (this.trendingActive) {
switch (this.discoverOptions) {
case DiscoverOption.Combined:
this.movies = await this.searchService.nowPlayingMoviesByPage(this.contentLoaded, 12);
this.tvShows = await this.searchService.trendingTvByPage(this.contentLoaded, 12);
this.movies = await this.searchService.nowPlayingMoviesByPage(this.contentLoaded, this.amountToLoad);
this.tvShows = await this.searchService.trendingTvByPage(this.contentLoaded, this.amountToLoad);
break;
case DiscoverOption.Movie:
this.movies = await this.searchService.nowPlayingMoviesByPage(this.contentLoaded, 12);
this.movies = await this.searchService.nowPlayingMoviesByPage(this.contentLoaded, this.amountToLoad);
break;
case DiscoverOption.Tv:
this.tvShows = await this.searchService.trendingTvByPage(this.contentLoaded, 12);
this.tvShows = await this.searchService.trendingTvByPage(this.contentLoaded, this.amountToLoad);
break;
}
}
if (this.upcomingActive) {
switch (this.discoverOptions) {
case DiscoverOption.Combined:
this.movies = await this.searchService.upcomingMoviesByPage(this.contentLoaded, 12);
this.tvShows = await this.searchService.anticipatedTvByPage(this.contentLoaded, 12);
this.movies = await this.searchService.upcomingMoviesByPage(this.contentLoaded, this.amountToLoad);
this.tvShows = await this.searchService.anticipatedTvByPage(this.contentLoaded, this.amountToLoad);
break;
case DiscoverOption.Movie:
this.movies = await this.searchService.upcomingMoviesByPage(this.contentLoaded, 12);
this.movies = await this.searchService.upcomingMoviesByPage(this.contentLoaded, this.amountToLoad);
break;
case DiscoverOption.Tv:
this.tvShows = await this.searchService.anticipatedTvByPage(this.contentLoaded, 12);
this.tvShows = await this.searchService.anticipatedTvByPage(this.contentLoaded, this.amountToLoad);
break;
}
}
@ -135,14 +137,14 @@ export class DiscoverComponent implements OnInit {
this.upcomingActive = false;
switch (this.discoverOptions) {
case DiscoverOption.Combined:
this.movies = await this.searchService.popularMoviesByPage(0, 12);
this.tvShows = await this.searchService.popularTvByPage(0, 12);
this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad);
this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad);
break;
case DiscoverOption.Movie:
this.movies = await this.searchService.popularMoviesByPage(0, 12);
this.movies = await this.searchService.popularMoviesByPage(0, this.amountToLoad);
break;
case DiscoverOption.Tv:
this.tvShows = await this.searchService.popularTvByPage(0, 12);
this.tvShows = await this.searchService.popularTvByPage(0, this.amountToLoad);
break;
}
@ -162,14 +164,14 @@ export class DiscoverComponent implements OnInit {
this.upcomingActive = false;
switch (this.discoverOptions) {
case DiscoverOption.Combined:
this.movies = await this.searchService.nowPlayingMoviesByPage(0, 12);
this.tvShows = await this.searchService.trendingTvByPage(0, 12);
this.movies = await this.searchService.nowPlayingMoviesByPage(0, this.amountToLoad);
this.tvShows = await this.searchService.trendingTvByPage(0, this.amountToLoad);
break;
case DiscoverOption.Movie:
this.movies = await this.searchService.nowPlayingMoviesByPage(0, 12);
this.movies = await this.searchService.nowPlayingMoviesByPage(0, this.amountToLoad);
break;
case DiscoverOption.Tv:
this.tvShows = await this.searchService.trendingTvByPage(0, 12);
this.tvShows = await this.searchService.trendingTvByPage(0, this.amountToLoad);
break;
}
@ -188,14 +190,14 @@ export class DiscoverComponent implements OnInit {
this.upcomingActive = true;
switch (this.discoverOptions) {
case DiscoverOption.Combined:
this.movies = await this.searchService.upcomingMoviesByPage(0, 12);
this.tvShows = await this.searchService.anticipatedTvByPage(0, 12);
this.movies = await this.searchService.upcomingMoviesByPage(0, this.amountToLoad);
this.tvShows = await this.searchService.anticipatedTvByPage(0, this.amountToLoad);
break;
case DiscoverOption.Movie:
this.movies = await this.searchService.upcomingMoviesByPage(0, 12);
this.movies = await this.searchService.upcomingMoviesByPage(0, this.amountToLoad);
break;
case DiscoverOption.Tv:
this.tvShows = await this.searchService.anticipatedTvByPage(0, 12);
this.tvShows = await this.searchService.anticipatedTvByPage(0, this.amountToLoad);
break;
}

@ -2,7 +2,7 @@
import { IEmbyServer, IEmbySettings } from "../../interfaces";
import { EmbyService, JobService, NotificationService, SettingsService, TesterService } from "../../services";
import { MatTabChangeEvent, MatTabGroup } from "@angular/material";
import { MatTabChangeEvent, MatTabGroup } from "@angular/material/tabs";
import {FormControl} from '@angular/forms';
@Component({

@ -4,7 +4,7 @@ import { takeUntil } from "rxjs/operators";
import { IPlexLibrariesSettings, IPlexServer, IPlexServerResponse, IPlexServerViewModel, IPlexSettings } from "../../interfaces";
import { JobService, NotificationService, PlexService, SettingsService, TesterService } from "../../services";
import { MatTabChangeEvent, MatTabGroup } from "@angular/material";
import { MatTabChangeEvent, MatTabGroup } from "@angular/material/tabs";
import {FormControl} from '@angular/forms';
@Component({

Loading…
Cancel
Save