From 93cae47925e4dd68b7d34a41927b2740b4fab1b4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 22 Jul 2019 15:40:13 +0200 Subject: Add client hooks --- .../app/videos/video-list/video-trending.component.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'client/src/app/videos/video-list/video-trending.component.ts') diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index 5f1d5055b..0e69bfd64 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts @@ -8,6 +8,7 @@ import { VideoService } from '../../shared/video/video.service' import { I18n } from '@ngx-translate/i18n-polyfill' import { ScreenService } from '@app/shared/misc/screen.service' import { Notifier, ServerService } from '@app/core' +import { HooksService } from '@app/core/plugins/hooks.service' @Component({ selector: 'my-videos-trending', @@ -28,7 +29,8 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, protected notifier: Notifier, protected authService: AuthService, protected screenService: ScreenService, - private videoService: VideoService + private videoService: VideoService, + private hooks: HooksService ) { super() } @@ -61,13 +63,20 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, getVideosObservable (page: number) { const newPagination = immutableAssign(this.pagination, { currentPage: page }) - return this.videoService.getVideos({ + const params = { videoPagination: newPagination, sort: this.sort, - filter: undefined, categoryOneOf: this.categoryOneOf, languageOneOf: this.languageOneOf - }) + } + + return this.hooks.wrapObsFun( + this.videoService.getVideos.bind(this.videoService), + params, + 'common', + 'filter:api.videos.list.trending.params', + 'filter:api.videos.list.trending.result' + ) } generateSyndicationList () { -- cgit v1.2.3