]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/videos/video-list/video-user-subscriptions.component.ts
Merge branch 'release/v1.3.0' into develop
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-list / video-user-subscriptions.component.ts
CommitLineData
22a16e36
C
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils'
22a16e36
C
4import { AuthService } from '../../core/auth'
5import { AbstractVideoList } from '../../shared/video/abstract-video-list'
6import { VideoSortField } from '../../shared/video/sort-field.type'
7import { VideoService } from '../../shared/video/video.service'
8import { I18n } from '@ngx-translate/i18n-polyfill'
9import { ScreenService } from '@app/shared/misc/screen.service'
10import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
489290b8 11import { Notifier, ServerService } from '@app/core'
22a16e36
C
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})
18export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy {
19 titlePage: string
22a16e36
C
20 sort = '-publishedAt' as VideoSortField
21 ownerDisplayType: OwnerDisplayType = 'auto'
34c7f429 22 groupByDate = true
22a16e36
C
23
24 constructor (
34c7f429 25 protected i18n: I18n,
22a16e36 26 protected router: Router,
489290b8 27 protected serverService: ServerService,
22a16e36 28 protected route: ActivatedRoute,
f8b2c1b4 29 protected notifier: Notifier,
22a16e36 30 protected authService: AuthService,
22a16e36
C
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}