]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/video-list/video-user-subscriptions.component.ts
Add button in subscriptions to go to subscriptions list
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-list / video-user-subscriptions.component.ts
index 3caa371d8886562d5ee67609c3bf0a60b1d849d1..0cd67db29dd8a690623695142d694a4dce63a3b5 100644 (file)
@@ -9,6 +9,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill'
 import { ScreenService } from '@app/shared/misc/screen.service'
 import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
 import { Notifier, ServerService } from '@app/core'
+import { HooksService } from '@app/core/plugins/hooks.service'
 
 @Component({
   selector: 'my-videos-user-subscriptions',
@@ -29,11 +30,17 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
     protected notifier: Notifier,
     protected authService: AuthService,
     protected screenService: ScreenService,
-    private videoService: VideoService
+    private videoService: VideoService,
+    private hooks: HooksService
   ) {
     super()
 
     this.titlePage = i18n('Videos from your subscriptions')
+    this.actions.push({
+      routerLink: '/my-account/subscriptions',
+      label: i18n('Subscriptions'),
+      iconName: 'cog'
+    })
   }
 
   ngOnInit () {
@@ -46,8 +53,18 @@ export class VideoUserSubscriptionsComponent extends AbstractVideoList implement
 
   getVideosObservable (page: number) {
     const newPagination = immutableAssign(this.pagination, { currentPage: page })
+    const params = {
+      videoPagination: newPagination,
+      sort: this.sort
+    }
 
-    return this.videoService.getUserSubscriptionVideos(newPagination, this.sort)
+    return this.hooks.wrapObsFun(
+      this.videoService.getUserSubscriptionVideos.bind(this.videoService),
+      params,
+      'common',
+      'filter:api.user-subscriptions-videos.videos.list.params',
+      'filter:api.user-subscriptions-videos.videos.list.result'
+    )
   }
 
   generateSyndicationList () {