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