aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-list/video-trending.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/video-list/video-trending.component.ts')
-rw-r--r--client/src/app/videos/video-list/video-trending.component.ts12
1 files changed, 10 insertions, 2 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 accc5bfe5..d3c0f5316 100644
--- a/client/src/app/videos/video-list/video-trending.component.ts
+++ b/client/src/app/videos/video-list/video-trending.component.ts
@@ -8,7 +8,7 @@ import { VideoSortField } from '../../shared/video/sort-field.type'
8import { VideoService } from '../../shared/video/video.service' 8import { VideoService } from '../../shared/video/video.service'
9import { I18n } from '@ngx-translate/i18n-polyfill' 9import { I18n } from '@ngx-translate/i18n-polyfill'
10import { ScreenService } from '@app/shared/misc/screen.service' 10import { ScreenService } from '@app/shared/misc/screen.service'
11import { Notifier } from '@app/core' 11import { Notifier, ServerService } from '@app/core'
12 12
13@Component({ 13@Component({
14 selector: 'my-videos-trending', 14 selector: 'my-videos-trending',
@@ -19,6 +19,7 @@ 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
22 23
23 constructor ( 24 constructor (
24 protected router: Router, 25 protected router: Router,
@@ -27,12 +28,19 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit,
27 protected authService: AuthService, 28 protected authService: AuthService,
28 protected location: Location, 29 protected location: Location,
29 protected screenService: ScreenService, 30 protected screenService: ScreenService,
31 private serverService: ServerService,
30 protected i18n: I18n, 32 protected i18n: I18n,
31 private videoService: VideoService 33 private videoService: VideoService
32 ) { 34 ) {
33 super() 35 super()
34 36
35 this.titlePage = i18n('Trending') 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.'
36 } 44 }
37 45
38 ngOnInit () { 46 ngOnInit () {