]>
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' | |
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 | } |