X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-search%2Ffind-in-bulk.service.ts;h=125d5e2b868c5537509d7f63b9abb1dd5bbfb364;hb=52798aa5f277492d4dd2482bca9396d2e982fa19;hp=6d77941d3cccd19feb6cd11b767b440d6b1b539c;hpb=afb7d2d5c6ca09d2c678781ae4dd3f527604c1b4;p=github%2FChocobozzz%2FPeerTube.git 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 6d77941d3..125d5e2b8 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 @@ -1,23 +1,26 @@ import * as debug from 'debug' import { Observable, Subject } from 'rxjs' -import { first, map } from 'rxjs/operators' +import { filter, first, map } from 'rxjs/operators' import { Injectable } from '@angular/core' import { buildBulkObservable } from '@app/helpers' import { ResultList } from '@shared/models/common' import { Video, VideoChannel } from '../shared-main' import { VideoPlaylist } from '../shared-video-playlist' import { SearchService } from './search.service' +import { AdvancedSearch } from './advanced-search.model' -const logger = debug('peertube:search:FindInBulkService') +const debugLogger = debug('peertube:search:FindInBulkService') type BulkObservables

= { notifier: Subject

- result: Observable + result: Observable<{ params: P[], response: R }> } @Injectable() export class FindInBulkService { + private advancedSearchForBulk: AdvancedSearch + private getVideoInBulk: BulkObservables> private getChannelInBulk: BulkObservables> private getPlaylistInBulk: BulkObservables> @@ -28,20 +31,22 @@ export class FindInBulkService { this.getVideoInBulk = this.buildBulkObservableObject(this.getVideosInBulk.bind(this)) this.getChannelInBulk = this.buildBulkObservableObject(this.getChannelsInBulk.bind(this)) this.getPlaylistInBulk = this.buildBulkObservableObject(this.getPlaylistsInBulk.bind(this)) + + this.advancedSearchForBulk = new AdvancedSearch({ searchTarget: 'local' }) } getVideo (uuid: string): Observable

(bulkGet: (params: P[]) => Observable) { + const notifier = new Subject

() return { notifier,