X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2Fvideo-list%2Fvideo-trending.component.ts;h=8f3d3842b494a31c74e6de679ee8c3159b5fb918;hb=9a629c6efbe39dfac290347670ca41b0d7100f41;hp=ea65070f9c3c416f64af7664d568fa340f0feb8a;hpb=2a2c19dfef7a9aa313c6ca0798f271c9a63449a9;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/video-list/video-trending.component.ts b/client/src/app/videos/video-list/video-trending.component.ts index ea65070f9..8f3d3842b 100644 --- a/client/src/app/videos/video-list/video-trending.component.ts +++ b/client/src/app/videos/video-list/video-trending.component.ts @@ -7,6 +7,8 @@ import { AuthService } from '../../core/auth' import { AbstractVideoList } from '../../shared/video/abstract-video-list' import { VideoSortField } from '../../shared/video/sort-field.type' import { VideoService } from '../../shared/video/video.service' +import { I18n } from '@ngx-translate/i18n-polyfill' +import { ScreenService } from '@app/shared/misc/screen.service' @Component({ selector: 'my-videos-trending', @@ -14,17 +16,23 @@ import { VideoService } from '../../shared/video/video.service' templateUrl: '../../shared/video/abstract-video-list.html' }) export class VideoTrendingComponent extends AbstractVideoList implements OnInit, OnDestroy { - titlePage = 'Trending' + titlePage: string currentRoute = '/videos/trending' - defaultSort: VideoSortField = '-views' - - constructor (protected router: Router, - protected route: ActivatedRoute, - protected notificationsService: NotificationsService, - protected authService: AuthService, - protected location: Location, - private videoService: VideoService) { + defaultSort: VideoSortField = '-trending' + + constructor ( + protected router: Router, + protected route: ActivatedRoute, + protected notificationsService: NotificationsService, + protected authService: AuthService, + protected location: Location, + protected screenService: ScreenService, + protected i18n: I18n, + private videoService: VideoService + ) { super() + + this.titlePage = i18n('Trending') } ngOnInit () { @@ -39,10 +47,10 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, getVideosObservable (page: number) { const newPagination = immutableAssign(this.pagination, { currentPage: page }) - return this.videoService.getVideos(newPagination, this.sort) + return this.videoService.getVideos(newPagination, this.sort, undefined, this.categoryOneOf) } generateSyndicationList () { - this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort) + this.syndicationItems = this.videoService.getVideoFeedUrls(this.sort, undefined, this.categoryOneOf) } }