aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-playlist
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-02 14:49:25 +0200
committerChocobozzz <me@florianbigard.com>2019-08-02 14:49:25 +0200
commitad453580b20056fd80b3245d4db554f5ca1a5e29 (patch)
treeed07a6dbd8bc8cd27b22cd33dabcbd3d31deea07 /client/src/app/shared/video-playlist
parentdd570a34ff731a6cd98ef8f8bf83f234e804f6c1 (diff)
downloadPeerTube-ad453580b20056fd80b3245d4db554f5ca1a5e29.tar.gz
PeerTube-ad453580b20056fd80b3245d4db554f5ca1a5e29.tar.zst
PeerTube-ad453580b20056fd80b3245d4db554f5ca1a5e29.zip
Fix infinite scroll on big screens
Diffstat (limited to 'client/src/app/shared/video-playlist')
-rw-r--r--client/src/app/shared/video-playlist/video-add-to-playlist.component.ts2
-rw-r--r--client/src/app/shared/video-playlist/video-playlist.service.ts15
2 files changed, 12 insertions, 5 deletions
diff --git a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts b/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
index 08ceb21bc..72de84703 100644
--- a/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
+++ b/client/src/app/shared/video-playlist/video-add-to-playlist.component.ts
@@ -83,7 +83,7 @@ export class VideoAddToPlaylistComponent extends FormReactive implements OnInit,
83 83
84 load () { 84 load () {
85 forkJoin([ 85 forkJoin([
86 this.videoPlaylistService.listAccountPlaylists(this.user.account, '-updatedAt'), 86 this.videoPlaylistService.listAccountPlaylists(this.user.account, undefined,'-updatedAt'),
87 this.videoPlaylistService.doesVideoExistInPlaylist(this.video.id) 87 this.videoPlaylistService.doesVideoExistInPlaylist(this.video.id)
88 ]) 88 ])
89 .subscribe( 89 .subscribe(
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 b93a19356..376387082 100644
--- a/client/src/app/shared/video-playlist/video-playlist.service.ts
+++ b/client/src/app/shared/video-playlist/video-playlist.service.ts
@@ -45,21 +45,28 @@ export class VideoPlaylistService {
45 ) 45 )
46 } 46 }
47 47
48 listChannelPlaylists (videoChannel: VideoChannel): Observable<ResultList<VideoPlaylist>> { 48 listChannelPlaylists (videoChannel: VideoChannel, componentPagination: ComponentPagination): Observable<ResultList<VideoPlaylist>> {
49 const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.nameWithHost + '/video-playlists' 49 const url = VideoChannelService.BASE_VIDEO_CHANNEL_URL + videoChannel.nameWithHost + '/video-playlists'
50 const pagination = this.restService.componentPaginationToRestPagination(componentPagination)
50 51
51 return this.authHttp.get<ResultList<VideoPlaylist>>(url) 52 let params = new HttpParams()
53 params = this.restService.addRestGetParams(params, pagination)
54
55 return this.authHttp.get<ResultList<VideoPlaylist>>(url, { params })
52 .pipe( 56 .pipe(
53 switchMap(res => this.extractPlaylists(res)), 57 switchMap(res => this.extractPlaylists(res)),
54 catchError(err => this.restExtractor.handleError(err)) 58 catchError(err => this.restExtractor.handleError(err))
55 ) 59 )
56 } 60 }
57 61
58 listAccountPlaylists (account: Account, sort: string): Observable<ResultList<VideoPlaylist>> { 62 listAccountPlaylists (account: Account, componentPagination: ComponentPagination, sort: string): Observable<ResultList<VideoPlaylist>> {
59 const url = AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-playlists' 63 const url = AccountService.BASE_ACCOUNT_URL + account.nameWithHost + '/video-playlists'
64 const pagination = componentPagination
65 ? this.restService.componentPaginationToRestPagination(componentPagination)
66 : undefined
60 67
61 let params = new HttpParams() 68 let params = new HttpParams()
62 params = this.restService.addRestGetParams(params, undefined, sort) 69 params = this.restService.addRestGetParams(params, pagination, sort)
63 70
64 return this.authHttp.get<ResultList<VideoPlaylist>>(url, { params }) 71 return this.authHttp.get<ResultList<VideoPlaylist>>(url, { params })
65 .pipe( 72 .pipe(