diff options
Diffstat (limited to 'client/src/app/+videos/video-list/trending/video-trending-header.component.ts')
-rw-r--r-- | client/src/app/+videos/video-list/trending/video-trending-header.component.ts | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/client/src/app/+videos/video-list/trending/video-trending-header.component.ts b/client/src/app/+videos/video-list/trending/video-trending-header.component.ts index bbb02a236..6c2b32a4f 100644 --- a/client/src/app/+videos/video-list/trending/video-trending-header.component.ts +++ b/client/src/app/+videos/video-list/trending/video-trending-header.component.ts | |||
@@ -1,10 +1,10 @@ | |||
1 | import { Subscription } from 'rxjs' | ||
1 | import { Component, HostBinding, Inject, OnDestroy, OnInit } from '@angular/core' | 2 | import { Component, HostBinding, Inject, OnDestroy, OnInit } from '@angular/core' |
2 | import { ActivatedRoute, Router } from '@angular/router' | 3 | import { ActivatedRoute, Router } from '@angular/router' |
3 | import { VideoListHeaderComponent } from '@app/shared/shared-video-miniature' | ||
4 | import { GlobalIconName } from '@app/shared/shared-icons' | ||
5 | import { ServerService } from '@app/core/server/server.service' | ||
6 | import { Subscription } from 'rxjs' | ||
7 | import { AuthService, RedirectService } from '@app/core' | 4 | import { AuthService, RedirectService } from '@app/core' |
5 | import { ServerService } from '@app/core/server/server.service' | ||
6 | import { GlobalIconName } from '@app/shared/shared-icons' | ||
7 | import { VideoListHeaderComponent } from '@app/shared/shared-video-miniature' | ||
8 | 8 | ||
9 | interface VideoTrendingHeaderItem { | 9 | interface VideoTrendingHeaderItem { |
10 | label: string | 10 | label: string |
@@ -67,21 +67,19 @@ export class VideoTrendingHeaderComponent extends VideoListHeaderComponent imple | |||
67 | } | 67 | } |
68 | 68 | ||
69 | ngOnInit () { | 69 | ngOnInit () { |
70 | this.serverService.getConfig() | 70 | const serverConfig = this.serverService.getHTMLConfig() |
71 | .subscribe(config => { | 71 | const algEnabled = serverConfig.trending.videos.algorithms.enabled |
72 | const algEnabled = config.trending.videos.algorithms.enabled | ||
73 | 72 | ||
74 | this.buttons = this.buttons.map(b => { | 73 | this.buttons = this.buttons.map(b => { |
75 | b.hidden = !algEnabled.includes(b.value) | 74 | b.hidden = !algEnabled.includes(b.value) |
76 | 75 | ||
77 | // Best is adapted by the user history so | 76 | // Best is adapted by the user history so |
78 | if (b.value === 'best' && !this.auth.isLoggedIn()) { | 77 | if (b.value === 'best' && !this.auth.isLoggedIn()) { |
79 | b.hidden = true | 78 | b.hidden = true |
80 | } | 79 | } |
81 | 80 | ||
82 | return b | 81 | return b |
83 | }) | 82 | }) |
84 | }) | ||
85 | 83 | ||
86 | this.algorithmChangeSub = this.route.queryParams.subscribe( | 84 | this.algorithmChangeSub = this.route.queryParams.subscribe( |
87 | queryParams => { | 85 | queryParams => { |