diff options
author | Chocobozzz <me@florianbigard.com> | 2021-05-03 11:06:19 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-05-03 16:42:15 +0200 |
commit | 1fd61899eaea245a5844e33e21f04b2562f16e5e (patch) | |
tree | 2a1d51b37b12219cade35e189d62686cd0fec105 /client/src/app/shared/shared-main | |
parent | dfcb6f50a607b6b402b4f8fa3d43792d61c912a5 (diff) | |
download | PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.tar.gz PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.tar.zst PeerTube-1fd61899eaea245a5844e33e21f04b2562f16e5e.zip |
Add ability to filter my videos by live
Diffstat (limited to 'client/src/app/shared/shared-main')
-rw-r--r-- | client/src/app/shared/shared-main/video/video.service.ts | 18 |
1 files changed, 17 insertions, 1 deletions
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 { | |||
124 | 124 | ||
125 | let params = new HttpParams() | 125 | let params = new HttpParams() |
126 | params = this.restService.addRestGetParams(params, pagination, sort) | 126 | params = this.restService.addRestGetParams(params, pagination, sort) |
127 | params = this.restService.addObjectParams(params, { search }) | 127 | |
128 | if (search) { | ||
129 | const filters = this.restService.parseQueryStringFilter(search, { | ||
130 | isLive: { | ||
131 | prefix: 'isLive:', | ||
132 | isBoolean: true, | ||
133 | handler: v => { | ||
134 | if (v === 'true') return v | ||
135 | if (v === 'false') return v | ||
136 | |||
137 | return undefined | ||
138 | } | ||
139 | } | ||
140 | }) | ||
141 | |||
142 | params = this.restService.addObjectParams(params, filters) | ||
143 | } | ||
128 | 144 | ||
129 | return this.authHttp | 145 | return this.authHttp |
130 | .get<ResultList<Video>>(UserService.BASE_USERS_URL + 'me/videos', { params }) | 146 | .get<ResultList<Video>>(UserService.BASE_USERS_URL + 'me/videos', { params }) |