X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-video-playlist%2Fvideo-playlist.service.ts;h=fc291329ad5ecb8a72879a54ed506eb1fd289644;hb=2cc276f92fefeff88fcc74217e1174a3ddb3f074;hp=0a01af5937a465813dae4683530a0dd07ffb284c;hpb=9df52d660feb722404be00a50f3c8a612bec1c15;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-video-playlist/video-playlist.service.ts b/client/src/app/shared/shared-video-playlist/video-playlist.service.ts index 0a01af593..fc291329a 100644 --- a/client/src/app/shared/shared-video-playlist/video-playlist.service.ts +++ b/client/src/app/shared/shared-video-playlist/video-playlist.service.ts @@ -2,7 +2,7 @@ import * as debug from 'debug' import { merge, Observable, of, ReplaySubject, Subject } from 'rxjs' import { catchError, filter, map, share, switchMap, tap } from 'rxjs/operators' import { HttpClient, HttpParams } from '@angular/common/http' -import { Injectable, NgZone } from '@angular/core' +import { Injectable } from '@angular/core' import { AuthUser, ComponentPaginationLight, RestExtractor, RestService, ServerService } from '@app/core' import { buildBulkObservable, objectToFormData } from '@app/helpers' import { Account, AccountService, VideoChannel, VideoChannelService } from '@app/shared/shared-main' @@ -47,16 +47,14 @@ export class VideoPlaylistService { private authHttp: HttpClient, private serverService: ServerService, private restExtractor: RestExtractor, - private restService: RestService, - private ngZone: NgZone + private restService: RestService ) { this.videoExistsInPlaylistObservable = merge( buildBulkObservable({ time: 500, - ngZone: this.ngZone, bulkGet: this.doVideosExistInPlaylist.bind(this), notifierObservable: this.videoExistsInPlaylistNotifier - }), + }).pipe(map(({ response }) => response)), this.videoExistsInPlaylistCacheSubject ) @@ -256,12 +254,12 @@ export class VideoPlaylistService { ) } - getPlaylistVideos ( - videoPlaylistId: number | string, + getPlaylistVideos (options: { + videoPlaylistId: number | string componentPagination: ComponentPaginationLight - ): Observable> { - const path = VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL + videoPlaylistId + '/videos' - const pagination = this.restService.componentPaginationToRestPagination(componentPagination) + }): Observable> { + const path = VideoPlaylistService.BASE_VIDEO_PLAYLIST_URL + options.videoPlaylistId + '/videos' + const pagination = this.restService.componentPaginationToRestPagination(options.componentPagination) let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination)