aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-playlist/video-playlist.service.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2019-12-26 11:52:46 +0100
committerRigel Kent <sendmemail@rigelk.eu>2019-12-26 11:52:52 +0100
commitc06af5012ecc925ca924e6e20db3a1d909b1148e (patch)
tree88a3595bfd0a68e8f5314737a22f9516d9790c9b /client/src/app/shared/video-playlist/video-playlist.service.ts
parentdef2a70b7e5ee807d7b532df8c9d33d17d24ccbb (diff)
downloadPeerTube-c06af5012ecc925ca924e6e20db3a1d909b1148e.tar.gz
PeerTube-c06af5012ecc925ca924e6e20db3a1d909b1148e.tar.zst
PeerTube-c06af5012ecc925ca924e6e20db3a1d909b1148e.zip
Add playlist search option and search input for add-to-video-playlist dropdown
fixes #2138
Diffstat (limited to 'client/src/app/shared/video-playlist/video-playlist.service.ts')
-rw-r--r--client/src/app/shared/video-playlist/video-playlist.service.ts10
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/app/shared/video-playlist/video-playlist.service.ts b/client/src/app/shared/video-playlist/video-playlist.service.ts
index 2945b4959..5f74dcd4c 100644
--- a/client/src/app/shared/video-playlist/video-playlist.service.ts
+++ b/client/src/app/shared/video-playlist/video-playlist.service.ts
@@ -59,7 +59,12 @@ export class VideoPlaylistService {
59 ) 59 )
60 } 60 }
61 61
62 listAccountPlaylists (account: Account, componentPagination: ComponentPagination, sort: string): Observable<ResultList<VideoPlaylist>> { 62 listAccountPlaylists (
63 account: Account,
64 componentPagination: ComponentPagination,
65 sort: string,
66 search?: string
67 ): Observable<ResultList<VideoPlaylist>> {
63 const url = AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-playlists' 68 const url = AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-playlists'
64 const pagination = componentPagination 69 const pagination = componentPagination
65 ? this.restService.componentPaginationToRestPagination(componentPagination) 70 ? this.restService.componentPaginationToRestPagination(componentPagination)
@@ -67,6 +72,7 @@ export class VideoPlaylistService {
67 72
68 let params = new HttpParams() 73 let params = new HttpParams()
69 params = this.restService.addRestGetParams(params, pagination, sort) 74 params = this.restService.addRestGetParams(params, pagination, sort)
75 if (search) params = this.restService.addObjectParams(params, { search })
70 76
71 return this.authHttp.get<ResultList<VideoPlaylist>>(url, { params }) 77 return this.authHttp.get<ResultList<VideoPlaylist>>(url, { params })
72 .pipe( 78 .pipe(
@@ -213,8 +219,8 @@ export class VideoPlaylistService {
213 219
214 private doVideosExistInPlaylist (videoIds: number[]): Observable<VideoExistInPlaylist> { 220 private doVideosExistInPlaylist (videoIds: number[]): Observable<VideoExistInPlaylist> {
215 const url = VideoPlaylistService.MY_VIDEO_PLAYLIST_URL + 'videos-exist' 221 const url = VideoPlaylistService.MY_VIDEO_PLAYLIST_URL + 'videos-exist'
216 let params = new HttpParams()
217 222
223 let params = new HttpParams()
218 params = this.restService.addObjectParams(params, { videoIds }) 224 params = this.restService.addObjectParams(params, { videoIds })
219 225
220 return this.authHttp.get<VideoExistInPlaylist>(url, { params }) 226 return this.authHttp.get<VideoExistInPlaylist>(url, { params })