1 import { Component, OnDestroy, OnInit } from '@angular/core'
2 import { ActivatedRoute, Router } from '@angular/router'
3 import { immutableAssign } from '@app/shared/misc/utils'
4 import { AuthService } from '../../core/auth'
5 import { AbstractVideoList } from '../../shared/video/abstract-video-list'
6 import { VideoSortField } from '../../shared/video/sort-field.type'
7 import { VideoService } from '../../shared/video/video.service'
8 import { I18n } from '@ngx-translate/i18n-polyfill'
9 import { ScreenService } from '@app/shared/misc/screen.service'
10 import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
11 import { Notifier, ServerService } from '@app/core'
12 import { HooksService } from '@app/core/plugins/hooks.service'
15 selector: 'my-videos-user-subscriptions',
16 styleUrls: [ '../../shared/video/abstract-video-list.scss' ],
17 templateUrl: '../../shared/video/abstract-video-list.html'
19 export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy {
21 sort = '-publishedAt' as VideoSortField
22 ownerDisplayType: OwnerDisplayType = 'auto'
27 protected router: Router,
28 protected serverService: ServerService,
29 protected route: ActivatedRoute,
30 protected notifier: Notifier,
31 protected authService: AuthService,
32 protected screenService: ScreenService,
33 private videoService: VideoService,
34 private hooks: HooksService
38 this.titlePage = i18n('Videos from your subscriptions')
49 getVideosObservable (page: number) {
50 const newPagination = immutableAssign(this.pagination, { currentPage: page })
52 videoPagination: newPagination,
56 return this.hooks.wrapObsFun(
57 this.videoService.getUserSubscriptionVideos.bind(this.videoService),
60 'filter:api.user-subscriptions-videos.videos.list.params',
61 'filter:api.user-subscriptions-videos.videos.list.result'
65 generateSyndicationList () {
66 // not implemented yet