From 93cae47925e4dd68b7d34a41927b2740b4fab1b4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 22 Jul 2019 15:40:13 +0200 Subject: Add client hooks --- .../video-list/video-recently-added.component.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'client/src/app/videos/video-list/video-recently-added.component.ts') diff --git a/client/src/app/videos/video-list/video-recently-added.component.ts b/client/src/app/videos/video-list/video-recently-added.component.ts index 19522e6b4..638e7caed 100644 --- a/client/src/app/videos/video-list/video-recently-added.component.ts +++ b/client/src/app/videos/video-list/video-recently-added.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-recently-added', @@ -29,7 +30,8 @@ export class VideoRecentlyAddedComponent extends AbstractVideoList implements On protected notifier: Notifier, protected authService: AuthService, protected screenService: ScreenService, - private videoService: VideoService + private videoService: VideoService, + private hooks: HooksService ) { super() @@ -48,14 +50,20 @@ export class VideoRecentlyAddedComponent extends AbstractVideoList implements On 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.recently-added.params', + 'filter:api.videos.list.recently-added.result' + ) } generateSyndicationList () { -- cgit v1.2.3