X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2F%2Bvideos%2F%2Bvideo-watch%2Frecommendations%2Frecent-videos-recommendation.service.ts;h=4654da8472e4276f7b394a328e152b9697082410;hb=fa12eacc014aae8094d108634371640f2695bf9f;hp=29fa268f4bc45a9d713854c03af654ac90689e87;hpb=1942f11d5ee6926ad93dc1b79fae18325ba5de18;p=github%2FChocobozzz%2FPeerTube.git 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 29fa268f4..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' import { ServerService, UserService } from '@app/core' import { Video, VideoService } from '@app/shared/shared-main' import { AdvancedSearch, SearchService } from '@app/shared/shared-search' -import { ServerConfig } from '@shared/models' +import { HTMLServerConfig } from '@shared/models' import { RecommendationInfo } from './recommendation-info.model' import { RecommendationService } from './recommendations.service' @@ -15,7 +15,7 @@ import { RecommendationService } from './recommendations.service' export class RecentVideosRecommendationService implements RecommendationService { readonly pageSize = 5 - private config: ServerConfig + private config: HTMLServerConfig constructor ( private videos: VideoService, @@ -23,13 +23,11 @@ export class RecentVideosRecommendationService implements RecommendationService private userService: UserService, private serverService: ServerService ) { - this.config = this.serverService.getTmpConfig() - - this.serverService.getConfig() - .subscribe(config => this.config = config) + this.config = this.serverService.getHTMLConfig() } getRecommendations (recommendation: RecommendationInfo): Observable { + return this.fetchPage(1, recommendation) .pipe( map(videos => { @@ -61,7 +59,7 @@ export class RecentVideosRecommendationService implements RecommendationService componentPagination: pagination, advancedSearch: new AdvancedSearch({ tagsOneOf: recommendation.tags.join(','), - sort: '-createdAt', + sort: '-publishedAt', searchTarget: 'local', nsfw: user.nsfwPolicy ? this.videos.nsfwPolicyToParam(user.nsfwPolicy)