diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-04 13:31:41 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-04 15:45:44 +0200 |
commit | 2989628b7913383b39ac34c7db8666a21f8e5037 (patch) | |
tree | ac7759177c04e524e7845143fd685aefb49e810e /client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts | |
parent | 8e08d415f9473b6b72fef698729453e726da16e7 (diff) | |
download | PeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.tar.gz PeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.tar.zst PeerTube-2989628b7913383b39ac34c7db8666a21f8e5037.zip |
Use HTML config when possible
Diffstat (limited to 'client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts')
-rw-r--r-- | client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts b/client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts index 2a851f13a..4654da847 100644 --- a/client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts +++ b/client/src/app/+videos/+video-watch/recommendations/recent-videos-recommendation.service.ts | |||
@@ -4,7 +4,7 @@ import { Injectable } from '@angular/core' | |||
4 | import { ServerService, UserService } from '@app/core' | 4 | import { ServerService, UserService } from '@app/core' |
5 | import { Video, VideoService } from '@app/shared/shared-main' | 5 | import { Video, VideoService } from '@app/shared/shared-main' |
6 | import { AdvancedSearch, SearchService } from '@app/shared/shared-search' | 6 | import { AdvancedSearch, SearchService } from '@app/shared/shared-search' |
7 | import { ServerConfig } from '@shared/models' | 7 | import { HTMLServerConfig } from '@shared/models' |
8 | import { RecommendationInfo } from './recommendation-info.model' | 8 | import { RecommendationInfo } from './recommendation-info.model' |
9 | import { RecommendationService } from './recommendations.service' | 9 | import { RecommendationService } from './recommendations.service' |
10 | 10 | ||
@@ -15,7 +15,7 @@ import { RecommendationService } from './recommendations.service' | |||
15 | export class RecentVideosRecommendationService implements RecommendationService { | 15 | export class RecentVideosRecommendationService implements RecommendationService { |
16 | readonly pageSize = 5 | 16 | readonly pageSize = 5 |
17 | 17 | ||
18 | private config: ServerConfig | 18 | private config: HTMLServerConfig |
19 | 19 | ||
20 | constructor ( | 20 | constructor ( |
21 | private videos: VideoService, | 21 | private videos: VideoService, |
@@ -23,13 +23,11 @@ export class RecentVideosRecommendationService implements RecommendationService | |||
23 | private userService: UserService, | 23 | private userService: UserService, |
24 | private serverService: ServerService | 24 | private serverService: ServerService |
25 | ) { | 25 | ) { |
26 | this.config = this.serverService.getTmpConfig() | 26 | this.config = this.serverService.getHTMLConfig() |
27 | |||
28 | this.serverService.getConfig() | ||
29 | .subscribe(config => this.config = config) | ||
30 | } | 27 | } |
31 | 28 | ||
32 | getRecommendations (recommendation: RecommendationInfo): Observable<Video[]> { | 29 | getRecommendations (recommendation: RecommendationInfo): Observable<Video[]> { |
30 | |||
33 | return this.fetchPage(1, recommendation) | 31 | return this.fetchPage(1, recommendation) |
34 | .pipe( | 32 | .pipe( |
35 | map(videos => { | 33 | map(videos => { |