]>
Commit | Line | Data |
---|---|---|
22a16e36 C |
1 | import { Component, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | |
3 | import { immutableAssign } from '@app/shared/misc/utils' | |
22a16e36 C |
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' | |
489290b8 | 11 | import { 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 | }) | |
18 | export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy { | |
19 | titlePage: string | |
22a16e36 C |
20 | sort = '-publishedAt' as VideoSortField |
21 | ownerDisplayType: OwnerDisplayType = 'auto' | |
22 | ||
23 | constructor ( | |
24 | protected router: Router, | |
489290b8 | 25 | protected serverService: ServerService, |
22a16e36 | 26 | protected route: ActivatedRoute, |
f8b2c1b4 | 27 | protected notifier: Notifier, |
22a16e36 | 28 | protected authService: AuthService, |
22a16e36 | 29 | protected screenService: ScreenService, |
489290b8 | 30 | private i18n: I18n, |
22a16e36 C |
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 | } |