From 1fd61899eaea245a5844e33e21f04b2562f16e5e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 3 May 2021 11:06:19 +0200 Subject: Add ability to filter my videos by live --- .../src/app/shared/shared-main/video/video.service.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'client/src/app/shared/shared-main/video/video.service.ts') 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 0b708b692..668e51f73 100644 --- a/client/src/app/shared/shared-main/video/video.service.ts +++ b/client/src/app/shared/shared-main/video/video.service.ts @@ -124,7 +124,23 @@ export class VideoService implements VideosProvider { let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination, sort) - params = this.restService.addObjectParams(params, { search }) + + if (search) { + const filters = this.restService.parseQueryStringFilter(search, { + isLive: { + prefix: 'isLive:', + isBoolean: true, + handler: v => { + if (v === 'true') return v + if (v === 'false') return v + + return undefined + } + } + }) + + params = this.restService.addObjectParams(params, filters) + } return this.authHttp .get>(UserService.BASE_USERS_URL + 'me/videos', { params }) -- cgit v1.2.3