aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos')
-rw-r--r--client/src/app/videos/video-list/video-trending.component.ts22
1 files changed, 13 insertions, 9 deletions
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 d3c0f5316..881ab2174 100644
--- a/client/src/app/videos/video-list/video-trending.component.ts
+++ b/client/src/app/videos/video-list/video-trending.component.ts
@@ -19,7 +19,6 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
19 titlePage: string 19 titlePage: string
20 currentRoute = '/videos/trending' 20 currentRoute = '/videos/trending'
21 defaultSort: VideoSortField = '-trending' 21 defaultSort: VideoSortField = '-trending'
22 trendingDays: number
23 22
24 constructor ( 23 constructor (
25 protected router: Router, 24 protected router: Router,
@@ -33,20 +32,25 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
33 private videoService: VideoService 32 private videoService: VideoService
34 ) { 33 ) {
35 super() 34 super()
36
37 this.trendingDays = this.serverService.getConfig().trending.videos.intervalDays
38
39 this.titlePage = this.i18n('Trending for the last ')
40 this.trendingDays === 1 ? this.titlePage += '24 hours' : this.titlePage += this.trendingDays + ' days'
41
42 this.titleTooltip = this.i18n('trending videos are those totalizing the greatest number of views during the last ')
43 this.trendingDays === 1 ? this.titleTooltip += '24 hours.' : this.titleTooltip += this.trendingDays + ' days.'
44 } 35 }
45 36
46 ngOnInit () { 37 ngOnInit () {
47 super.ngOnInit() 38 super.ngOnInit()
48 39
49 this.generateSyndicationList() 40 this.generateSyndicationList()
41
42 const trendingDays = this.serverService.getConfig().trending.videos.intervalDays
43
44 if (trendingDays === 1) {
45 this.titlePage = this.i18n('Trending for the last 24 hours')
46 this.titleTooltip = this.i18n('Trending videos are those totalizing the greatest number of views during the last 24 hours.')
47 } else {
48 this.titlePage = this.i18n('Trending for the last {{days}} days', { days: trendingDays })
49 this.titleTooltip = this.i18n(
50 'Trending videos are those totalizing the greatest number of views during the last {{days}} days.',
51 { days: trendingDays }
52 )
53 }
50 } 54 }
51 55
52 ngOnDestroy () { 56 ngOnDestroy () {