]>
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' | |
4 | import { Location } from '@angular/common' | |
22a16e36 C |
5 | import { AuthService } from '../../core/auth' |
6 | import { AbstractVideoList } from '../../shared/video/abstract-video-list' | |
7 | import { VideoSortField } from '../../shared/video/sort-field.type' | |
8 | import { VideoService } from '../../shared/video/video.service' | |
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | |
10 | import { ScreenService } from '@app/shared/misc/screen.service' | |
11 | import { OwnerDisplayType } from '@app/shared/video/video-miniature.component' | |
f8b2c1b4 | 12 | import { Notifier } from '@app/core' |
22a16e36 C |
13 | |
14 | @Component({ | |
15 | selector: 'my-videos-user-subscriptions', | |
16 | styleUrls: [ '../../shared/video/abstract-video-list.scss' ], | |
17 | templateUrl: '../../shared/video/abstract-video-list.html' | |
18 | }) | |
19 | export class VideoUserSubscriptionsComponent extends AbstractVideoList implements OnInit, OnDestroy { | |
20 | titlePage: string | |
21 | currentRoute = '/videos/subscriptions' | |
22 | sort = '-publishedAt' as VideoSortField | |
23 | ownerDisplayType: OwnerDisplayType = 'auto' | |
24 | ||
25 | constructor ( | |
26 | protected router: Router, | |
27 | protected route: ActivatedRoute, | |
f8b2c1b4 | 28 | protected notifier: Notifier, |
22a16e36 C |
29 | protected authService: AuthService, |
30 | protected location: Location, | |
31 | protected i18n: I18n, | |
32 | protected screenService: ScreenService, | |
33 | private videoService: VideoService | |
34 | ) { | |
35 | super() | |
36 | ||
37 | this.titlePage = i18n('Videos from your subscriptions') | |
38 | } | |
39 | ||
40 | ngOnInit () { | |
41 | super.ngOnInit() | |
42 | } | |
43 | ||
44 | ngOnDestroy () { | |
45 | super.ngOnDestroy() | |
46 | } | |
47 | ||
48 | getVideosObservable (page: number) { | |
49 | const newPagination = immutableAssign(this.pagination, { currentPage: page }) | |
50 | ||
51 | return this.videoService.getUserSubscriptionVideos(newPagination, this.sort) | |
52 | } | |
53 | ||
54 | generateSyndicationList () { | |
55 | // not implemented yet | |
56 | } | |
57 | } |