private subActivatedRoute: Subscription
private isInitialLoad = false // set to false to show the search filters on first arrival
- private channelsPerPage = 2
- private playlistsPerPage = 2
- private videosPerPage = 10
-
private hasMoreResults = true
private isSearching = false
private resetPagination () {
this.pagination.currentPage = 1
this.pagination.totalItems = null
- this.channelsPerPage = 2
this.results = []
}
private getVideosObs () {
const params = {
search: this.currentSearch,
- componentPagination: immutableAssign(this.pagination, { itemsPerPage: this.videosPerPage }),
+ componentPagination: immutableAssign(this.pagination, { itemsPerPage: 10 }),
advancedSearch: this.advancedSearch
}
private getVideoChannelObs () {
const params = {
search: this.currentSearch,
- componentPagination: immutableAssign(this.pagination, { itemsPerPage: this.channelsPerPage }),
+ componentPagination: immutableAssign(this.pagination, { itemsPerPage: this.buildChannelsPerPage() }),
advancedSearch: this.advancedSearch
}
private getVideoPlaylistObs () {
const params = {
search: this.currentSearch,
- componentPagination: immutableAssign(this.pagination, { itemsPerPage: this.playlistsPerPage }),
+ componentPagination: immutableAssign(this.pagination, { itemsPerPage: this.buildPlaylistsPerPage() }),
advancedSearch: this.advancedSearch
}
return undefined
}
+
+ private buildChannelsPerPage () {
+ if (this.advancedSearch.resultType === 'channels') return 10
+
+ return 2
+ }
+
+ private buildPlaylistsPerPage () {
+ if (this.advancedSearch.resultType === 'playlists') return 10
+
+ return 2
+ }
}