]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/video-list/video-user-subscriptions.component.ts
Restore videos list components
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-list / video-user-subscriptions.component.ts
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
13 @Component({
14 selector: 'my-videos-user-subscriptions',
15 styleUrls: [ '../../shared/video/abstract-video-list.scss' ],
16 templateUrl: '../../shared/video/abstract-video-list.html'
17 })
18 export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy {
19 titlePage: string
20 sort = '-publishedAt' as VideoSortField
21 ownerDisplayType: OwnerDisplayType = 'auto'
22
23 constructor (
24 protected router: Router,
25 protected serverService: ServerService,
26 protected route: ActivatedRoute,
27 protected notifier: Notifier,
28 protected authService: AuthService,
29 protected screenService: ScreenService,
30 private i18n: I18n,
31 private videoService: VideoService
32 ) {
33 super()
34
35 this.titlePage = i18n('Videos from your subscriptions')
36 }
37
38 ngOnInit () {
39 super.ngOnInit()
40 }
41
42 ngOnDestroy () {
43 super.ngOnDestroy()
44 }
45
46 getVideosObservable (page: number) {
47 const newPagination = immutableAssign(this.pagination, { currentPage: page })
48
49 return this.videoService.getUserSubscriptionVideos(newPagination, this.sort)
50 }
51
52 generateSyndicationList () {
53 // not implemented yet
54 }
55 }