diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-22 15:40:13 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 93cae47925e4dd68b7d34a41927b2740b4fab1b4 (patch) | |
tree | f649ab49fab1886b434e164591990cc99b234466 /client/src/app/videos/video-list/video-local.component.ts | |
parent | 587568e1cc0e33c023c1ac62dd28fef313285250 (diff) | |
download | PeerTube-93cae47925e4dd68b7d34a41927b2740b4fab1b4.tar.gz PeerTube-93cae47925e4dd68b7d34a41927b2740b4fab1b4.tar.zst PeerTube-93cae47925e4dd68b7d34a41927b2740b4fab1b4.zip |
Add client hooks
Diffstat (limited to 'client/src/app/videos/video-list/video-local.component.ts')
-rw-r--r-- | client/src/app/videos/video-list/video-local.component.ts | 17 |
1 files changed, 13 insertions, 4 deletions
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' | |||
10 | import { ScreenService } from '@app/shared/misc/screen.service' | 10 | import { ScreenService } from '@app/shared/misc/screen.service' |
11 | import { UserRight } from '../../../../../shared/models/users' | 11 | import { UserRight } from '../../../../../shared/models/users' |
12 | import { Notifier, ServerService } from '@app/core' | 12 | import { Notifier, ServerService } from '@app/core' |
13 | import { HooksService } from '@app/core/plugins/hooks.service' | ||
13 | 14 | ||
14 | @Component({ | 15 | @Component({ |
15 | selector: 'my-videos-local', | 16 | selector: 'my-videos-local', |
@@ -31,7 +32,8 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On | |||
31 | protected notifier: Notifier, | 32 | protected notifier: Notifier, |
32 | protected authService: AuthService, | 33 | protected authService: AuthService, |
33 | protected screenService: ScreenService, | 34 | protected screenService: ScreenService, |
34 | private videoService: VideoService | 35 | private videoService: VideoService, |
36 | private hooks: HooksService | ||
35 | ) { | 37 | ) { |
36 | super() | 38 | super() |
37 | 39 | ||
@@ -55,14 +57,21 @@ export class VideoLocalComponent extends AbstractVideoList implements OnInit, On | |||
55 | 57 | ||
56 | getVideosObservable (page: number) { | 58 | getVideosObservable (page: number) { |
57 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | 59 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) |
58 | 60 | const params = { | |
59 | return this.videoService.getVideos({ | ||
60 | videoPagination: newPagination, | 61 | videoPagination: newPagination, |
61 | sort: this.sort, | 62 | sort: this.sort, |
62 | filter: this.filter, | 63 | filter: this.filter, |
63 | categoryOneOf: this.categoryOneOf, | 64 | categoryOneOf: this.categoryOneOf, |
64 | languageOneOf: this.languageOneOf | 65 | languageOneOf: this.languageOneOf |
65 | }) | 66 | } |
67 | |||
68 | return this.hooks.wrapObsFun( | ||
69 | this.videoService.getVideos.bind(this.videoService), | ||
70 | params, | ||
71 | 'common', | ||
72 | 'filter:api.videos.list.local.params', | ||
73 | 'filter:api.videos.list.local.result' | ||
74 | ) | ||
66 | } | 75 | } |
67 | 76 | ||
68 | generateSyndicationList () { | 77 | generateSyndicationList () { |