]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/app/videos/video-list/video-user-subscriptions.component.ts
3caa371d8886562d5ee67609c3bf0a60b1d849d1
[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 groupByDate = true
23
24 constructor (
25 protected i18n: I18n,
26 protected router: Router,
27 protected serverService: ServerService,
28 protected route: ActivatedRoute,
29 protected notifier: Notifier,
30 protected authService: AuthService,
31 protected screenService: ScreenService,
32 private videoService: VideoService
33 ) {
34 super()
35
36 this.titlePage = i18n('Videos from your subscriptions')
37 }
38
39 ngOnInit () {
40 super.ngOnInit()
41 }
42
43 ngOnDestroy () {
44 super.ngOnDestroy()
45 }
46
47 getVideosObservable (page: number) {
48 const newPagination = immutableAssign(this.pagination, { currentPage: page })
49
50 return this.videoService.getUserSubscriptionVideos(newPagination, this.sort)
51 }
52
53 generateSyndicationList () {
54 // not implemented yet
55 }
56 }