aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-22 16:04:44 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commite8f902c05cb35f6d5e9b75a23ddabd51c220a976 (patch)
treeeb6297bc50206546cbae12c6abc5b50ed802b17e /client/src/app/videos/+video-watch
parent93cae47925e4dd68b7d34a41927b2740b4fab1b4 (diff)
downloadPeerTube-e8f902c05cb35f6d5e9b75a23ddabd51c220a976.tar.gz
PeerTube-e8f902c05cb35f6d5e9b75a23ddabd51c220a976.tar.zst
PeerTube-e8f902c05cb35f6d5e9b75a23ddabd51c220a976.zip
Use search client scope
Diffstat (limited to 'client/src/app/videos/+video-watch')
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comment.service.ts9
-rw-r--r--client/src/app/videos/+video-watch/comment/video-comments.component.ts4
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts2
3 files changed, 7 insertions, 8 deletions
diff --git a/client/src/app/videos/+video-watch/comment/video-comment.service.ts b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
index eb608a1a3..550d42fa8 100644
--- a/client/src/app/videos/+video-watch/comment/video-comment.service.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comment.service.ts
@@ -52,7 +52,7 @@ export class VideoCommentService {
52 videoId: number | string, 52 videoId: number | string,
53 componentPagination: ComponentPagination, 53 componentPagination: ComponentPagination,
54 sort: VideoSortField 54 sort: VideoSortField
55 }): Observable<{ comments: VideoComment[], totalComments: number}> { 55 }): Observable<ResultList<VideoComment>> {
56 const { videoId, componentPagination, sort } = parameters 56 const { videoId, componentPagination, sort } = parameters
57 57
58 const pagination = this.restService.componentPaginationToRestPagination(componentPagination) 58 const pagination = this.restService.componentPaginationToRestPagination(componentPagination)
@@ -61,10 +61,9 @@ export class VideoCommentService {
61 params = this.restService.addRestGetParams(params, pagination, sort) 61 params = this.restService.addRestGetParams(params, pagination, sort)
62 62
63 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads' 63 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads'
64 return this.authHttp 64 return this.authHttp.get<ResultList<VideoComment>>(url, { params })
65 .get(url, { params })
66 .pipe( 65 .pipe(
67 map(this.extractVideoComments), 66 map(result => this.extractVideoComments(result)),
68 catchError(err => this.restExtractor.handleError(err)) 67 catchError(err => this.restExtractor.handleError(err))
69 ) 68 )
70 } 69 }
@@ -136,7 +135,7 @@ export class VideoCommentService {
136 comments.push(new VideoComment(videoCommentJson)) 135 comments.push(new VideoComment(videoCommentJson))
137 } 136 }
138 137
139 return { comments, totalComments } 138 return { data: comments, total: totalComments }
140 } 139 }
141 140
142 private extractVideoCommentTree (tree: VideoCommentThreadTree) { 141 private extractVideoCommentTree (tree: VideoCommentThreadTree) {
diff --git a/client/src/app/videos/+video-watch/comment/video-comments.component.ts b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
index 3c1a0986c..5bafc55e5 100644
--- a/client/src/app/videos/+video-watch/comment/video-comments.component.ts
+++ b/client/src/app/videos/+video-watch/comment/video-comments.component.ts
@@ -122,8 +122,8 @@ export class VideoCommentsComponent implements OnInit, OnChanges, OnDestroy {
122 122
123 obs.subscribe( 123 obs.subscribe(
124 res => { 124 res => {
125 this.comments = this.comments.concat(res.comments) 125 this.comments = this.comments.concat(res.data)
126 this.componentPagination.totalItems = res.totalComments 126 this.componentPagination.totalItems = res.total
127 }, 127 },
128 128
129 err => this.notifier.error(err.message) 129 err => this.notifier.error(err.message)
diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts
index eed2ec048..0d9b6d680 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -103,7 +103,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
103 } 103 }
104 104
105 async ngOnInit () { 105 async ngOnInit () {
106 await this.pluginService.loadPluginsByScope('video-watch') 106 this.pluginService.loadPluginsByScope('video-watch')
107 107
108 this.configSub = this.serverService.configLoaded 108 this.configSub = this.serverService.configLoaded
109 .subscribe(() => { 109 .subscribe(() => {