From 978c87e7f58b6673fe60f04f1767bc9e02ea4936 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 20 Oct 2021 09:05:43 +0200 Subject: Add channel filters for my videos/followers --- .../app/shared/shared-main/video/video.service.ts | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'client/src/app/shared/shared-main/video') diff --git a/client/src/app/shared/shared-main/video/video.service.ts b/client/src/app/shared/shared-main/video/video.service.ts index 2f43f1b9d..7935569e7 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts @@ -13,6 +13,7 @@ import { UserVideoRateType, UserVideoRateUpdate, Video as VideoServerModel, + VideoChannel as VideoChannelServerModel, VideoConstant, VideoDetails as VideoDetailsServerModel, VideoFileMetadata, @@ -122,7 +123,14 @@ export class VideoService { .pipe(catchError(err => this.restExtractor.handleError(err))) } - getMyVideos (videoPagination: ComponentPaginationLight, sort: VideoSortField, search?: string): Observable> { + getMyVideos (options: { + videoPagination: ComponentPaginationLight + sort: VideoSortField + userChannels?: VideoChannelServerModel[] + search?: string + }): Observable> { + const { videoPagination, sort, userChannels = [], search } = options + const pagination = this.restService.componentToRestPagination(videoPagination) let params = new HttpParams() @@ -133,6 +141,16 @@ export class VideoService { isLive: { prefix: 'isLive:', isBoolean: true + }, + channelId: { + prefix: 'channel:', + handler: (name: string) => { + const channel = userChannels.find(c => c.name === name) + + if (channel) return channel.id + + return undefined + } } }) -- cgit v1.2.3