diff --git a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts index cbd5c7bf5..53fae6ad4 100644 --- a/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts +++ b/client/src/app/shared/shared-custom-markup/peertube-custom-tags/videos-list-markup.component.ts @@ -1,11 +1,12 @@ -import { finalize } from 'rxjs/operators' +import { finalize, map } from 'rxjs/operators' import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnInit, Output } from '@angular/core' import { AuthService, Notifier } from '@app/core' import { objectKeysTyped } from '@peertube/peertube-core-utils' -import { VideoSortField } from '@peertube/peertube-models' +import { ResultList, VideoSortField } from '@peertube/peertube-models' import { Video, VideoService } from '../../shared-main' import { MiniatureDisplayOptions } from '../../shared-video-miniature' import { CustomMarkupComponent } from './shared' +import { Observable } from 'rxjs' /* * Markup component list videos depending on criteria @@ -75,7 +76,7 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit return this.getVideosObservable() .pipe(finalize(() => this.loaded.emit(true))) .subscribe({ - next: ({ data }) => { + next: data => { this.videos = data this.cd.markForCheck() }, @@ -96,12 +97,16 @@ export class VideosListMarkupComponent implements CustomMarkupComponent, OnInit isLive: this.isLive, sort: this.sort as VideoSortField, account: { nameWithHost: this.accountHandle }, - videoChannel: { nameWithHost: this.channelHandle } + videoChannel: { nameWithHost: this.channelHandle }, + skipCount: true } - if (this.channelHandle) return this.videoService.getVideoChannelVideos(options) - if (this.accountHandle) return this.videoService.getAccountVideos(options) + let obs: Observable> - return this.videoService.getVideos(options) + if (this.channelHandle) obs = this.videoService.getVideoChannelVideos(options) + else if (this.accountHandle) obs = this.videoService.getAccountVideos(options) + else obs = this.videoService.getVideos(options) + + return obs.pipe(map(({ data }) => data)) } } diff --git a/client/src/app/shared/shared-search/find-in-bulk.service.ts b/client/src/app/shared/shared-search/find-in-bulk.service.ts index de57c7f64..9c02a5000 100644 --- a/client/src/app/shared/shared-search/find-in-bulk.service.ts +++ b/client/src/app/shared/shared-search/find-in-bulk.service.ts @@ -3,7 +3,6 @@ import { Observable, Subject } from 'rxjs' import { filter, first, map } from 'rxjs/operators' import { Injectable } from '@angular/core' import { buildBulkObservable } from '@app/helpers' -import { ResultList } from '@peertube/peertube-models' import { Video, VideoChannel } from '../shared-main' import { VideoPlaylist } from '../shared-video-playlist' import { AdvancedSearch } from './advanced-search.model' @@ -21,9 +20,9 @@ export class FindInBulkService { private advancedSearchForBulk: AdvancedSearch - private getVideoInBulk: BulkObservables> - private getChannelInBulk: BulkObservables> - private getPlaylistInBulk: BulkObservables> + private getVideoInBulk: BulkObservables + private getChannelInBulk: BulkObservables + private getPlaylistInBulk: BulkObservables constructor ( private searchService: SearchService @@ -66,7 +65,7 @@ export class FindInBulkService { } private getData

(options: { - observableObject: BulkObservables> + observableObject: BulkObservables param: P finder: (d: R) => boolean }) { @@ -104,6 +103,7 @@ export class FindInBulkService { return this.searchService.searchVideos({ uuids, componentPagination: { itemsPerPage: uuids.length, currentPage: 1 }, + skipCount: true, advancedSearch: this.advancedSearchForBulk }) }