- search () {
- forkJoin([
- this.getVideosObs(),
- this.getVideoChannelObs()
- ]).subscribe(
- ([videosResult, videoChannelsResult]) => {
- this.results = this.results
- .concat(videoChannelsResult.data)
- .concat(videosResult.data)
-
- this.pagination.totalItems = videosResult.total + videoChannelsResult.total
- this.lastSearchTarget = this.advancedSearch.searchTarget
-
- // Focus on channels if there are no enough videos
- if (this.firstSearch === true && videosResult.data.length < this.pagination.itemsPerPage) {
- this.resetPagination()
- this.firstSearch = false
-
- this.channelsPerPage = 10
- this.search()
- }
-
- this.firstSearch = false
- },