]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/videos/video-list/video-trending.component.ts
Add links support in comments
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / video-list / video-trending.component.ts
CommitLineData
f3aaa9a9 1import { Component, OnInit } from '@angular/core'
9bf9d2a5 2import { ActivatedRoute, Router } from '@angular/router'
0cd4344f 3import { immutableAssign } from '@app/shared/misc/utils'
9bf9d2a5 4import { NotificationsService } from 'angular2-notifications'
b2731bff 5import { AuthService } from '../../core/auth'
7bfd1b1e 6import { AbstractVideoList } from '../../shared/video/abstract-video-list'
f3aaa9a9
C
7import { SortField } from '../../shared/video/sort-field.type'
8import { VideoService } from '../../shared/video/video.service'
9bf9d2a5
C
9
10@Component({
11 selector: 'my-videos-trending',
202f6b6c
C
12 styleUrls: [ '../../shared/video/abstract-video-list.scss' ],
13 templateUrl: '../../shared/video/abstract-video-list.html'
9bf9d2a5 14})
f3aaa9a9 15export class VideoTrendingComponent extends AbstractVideoList implements OnInit {
9bf9d2a5 16 titlePage = 'Trending'
2bbb3412 17 currentRoute = '/videos/trending'
f3aaa9a9 18 defaultSort: SortField = '-views'
9bf9d2a5
C
19
20 constructor (protected router: Router,
21 protected route: ActivatedRoute,
22 protected notificationsService: NotificationsService,
b2731bff 23 protected authService: AuthService,
9bf9d2a5
C
24 private videoService: VideoService) {
25 super()
26 }
27
28 ngOnInit () {
29 super.ngOnInit()
30 }
31
0cd4344f
C
32 getVideosObservable (page: number) {
33 const newPagination = immutableAssign(this.pagination, { currentPage: page })
34 return this.videoService.getVideos(newPagination, this.sort)
9bf9d2a5
C
35 }
36}