aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-list/video-user-subscriptions.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-08-21 16:18:59 +0200
committerChocobozzz <me@florianbigard.com>2018-08-27 09:41:54 +0200
commit22a16e36f6526887ed8f5e5d3c9f9e5da0b4a8cd (patch)
tree93c53e0619f966bd9ff1bb698c411277a9447a41 /client/src/app/videos/video-list/video-user-subscriptions.component.ts
parent99492dbc0d87ef54d0dab7d8d44f8d0de5722bdd (diff)
downloadPeerTube-22a16e36f6526887ed8f5e5d3c9f9e5da0b4a8cd.tar.gz
PeerTube-22a16e36f6526887ed8f5e5d3c9f9e5da0b4a8cd.tar.zst
PeerTube-22a16e36f6526887ed8f5e5d3c9f9e5da0b4a8cd.zip
Add local user subscriptions
Diffstat (limited to 'client/src/app/videos/video-list/video-user-subscriptions.component.ts')
-rw-r--r--client/src/app/videos/video-list/video-user-subscriptions.component.ts57
1 files changed, 57 insertions, 0 deletions
diff --git a/client/src/app/videos/video-list/video-user-subscriptions.component.ts b/client/src/app/videos/video-list/video-user-subscriptions.component.ts
new file mode 100644
index 000000000..6e8959c54
--- /dev/null
+++ b/client/src/app/videos/video-list/video-user-subscriptions.component.ts
@@ -0,0 +1,57 @@
1import { Component, OnDestroy, OnInit } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router'
3import { immutableAssign } from '@app/shared/misc/utils'
4import { Location } from '@angular/common'
5import { NotificationsService } from 'angular2-notifications'
6import { AuthService } from '../../core/auth'
7import { AbstractVideoList } from '../../shared/video/abstract-video-list'
8import { VideoSortField } from '../../shared/video/sort-field.type'
9import { VideoService } from '../../shared/video/video.service'
10import { I18n } from '@ngx-translate/i18n-polyfill'
11import { ScreenService } from '@app/shared/misc/screen.service'
12import { OwnerDisplayType } from '@app/shared/video/video-miniature.component'
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})
19export 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,
28 protected notificationsService: NotificationsService,
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}