diff options
Diffstat (limited to 'client/src/app/videos/video-list')
-rw-r--r-- | client/src/app/videos/video-list/video-trending.component.ts | 21 |
1 files changed, 18 insertions, 3 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..6fd74e67a 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' | |||
8 | import { VideoService } from '../../shared/video/video.service' | 8 | import { VideoService } from '../../shared/video/video.service' |
9 | import { I18n } from '@ngx-translate/i18n-polyfill' | 9 | import { I18n } from '@ngx-translate/i18n-polyfill' |
10 | import { ScreenService } from '@app/shared/misc/screen.service' | 10 | import { ScreenService } from '@app/shared/misc/screen.service' |
11 | import { Notifier } from '@app/core' | 11 | import { Notifier, ServerService } from '@app/core' |
12 | 12 | ||
13 | @Component({ | 13 | @Component({ |
14 | selector: 'my-videos-trending', | 14 | selector: 'my-videos-trending', |
@@ -27,18 +27,33 @@ export class VideoTrendingComponent extends AbstractVideoList implements OnInit, | |||
27 | protected authService: AuthService, | 27 | protected authService: AuthService, |
28 | protected location: Location, | 28 | protected location: Location, |
29 | protected screenService: ScreenService, | 29 | protected screenService: ScreenService, |
30 | private serverService: ServerService, | ||
30 | protected i18n: I18n, | 31 | protected i18n: I18n, |
31 | private videoService: VideoService | 32 | private videoService: VideoService |
32 | ) { | 33 | ) { |
33 | super() | 34 | super() |
34 | |||
35 | this.titlePage = i18n('Trending') | ||
36 | } | 35 | } |
37 | 36 | ||
38 | ngOnInit () { | 37 | ngOnInit () { |
39 | super.ngOnInit() | 38 | super.ngOnInit() |
40 | 39 | ||
41 | this.generateSyndicationList() | 40 | this.generateSyndicationList() |
41 | |||
42 | this.serverService.configLoaded.subscribe( | ||
43 | () => { | ||
44 | const trendingDays = this.serverService.getConfig().trending.videos.intervalDays | ||
45 | |||
46 | if (trendingDays === 1) { | ||
47 | this.titlePage = this.i18n('Trending for the last 24 hours') | ||
48 | this.titleTooltip = this.i18n('Trending videos are those totalizing the greatest number of views during the last 24 hours.') | ||
49 | } else { | ||
50 | this.titlePage = this.i18n('Trending for the last {{days}} days', { days: trendingDays }) | ||
51 | this.titleTooltip = this.i18n( | ||
52 | 'Trending videos are those totalizing the greatest number of views during the last {{days}} days.', | ||
53 | { days: trendingDays } | ||
54 | ) | ||
55 | } | ||
56 | }) | ||
42 | } | 57 | } |
43 | 58 | ||
44 | ngOnDestroy () { | 59 | ngOnDestroy () { |