From 3d4e112d16471703f51a542c0cc6e73a6f5db628 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Tue, 2 Feb 2021 12:59:41 +0100 Subject: add best trending strategy based on Reddit's best inspired from https://www.reddit.com/r/changelog/comments/7spgg0/best_is_the_new_hotness/ this implementation only adds freshness, and doesn't personalize based on subscribed communities yet. --- server/models/video/video.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server/models/video/video.ts') diff --git a/server/models/video/video.ts b/server/models/video/video.ts index ea6c9d44b..0ecb8d600 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts @@ -1090,7 +1090,9 @@ export class VideoModel extends Model { const trendingDays = options.sort.endsWith('trending') ? CONFIG.TRENDING.VIDEOS.INTERVAL_DAYS : undefined - const hot = options.sort.endsWith('hot') + let trendingAlgorithm + if (options.sort.endsWith('hot')) trendingAlgorithm = 'hot' + if (options.sort.endsWith('best')) trendingAlgorithm = 'best' const serverActor = await getServerActor() @@ -1120,7 +1122,7 @@ export class VideoModel extends Model { user: options.user, historyOfUser: options.historyOfUser, trendingDays, - hot, + trendingAlgorithm, search: options.search } -- cgit v1.2.3