From bd3e96eaab7bcd9436661f1df4a9739a9276467d Mon Sep 17 00:00:00 2001 From: Ignazio Bovo Date: Tue, 14 Nov 2023 18:45:15 +0100 Subject: [PATCH] Hotfix/3.1.0 (#240) * Orion v3.1.0 (#238) * Add granular permissions support for Gateway operator users (#231) * Add granular permissions support for Gateway operator users * fix lint issues * revert docker-compose port change * mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean * Set Channel Weight (`setChannelsWeights`) mutation (#232) * Add granular permissions support for Gateway operator users * fix lint issues * add mutation to set channel weight/bias for homepage video relevance * revert docker-compose port change * mark 'grantPermissions' & 'revokePermissions' input fields are non-nullable & return new permissions instead of boolean * bump package version * update global migration counter map * bumped package version & updated CHANGELOG --------- Co-authored-by: Ignazio Bovo * Postgres performance improvements (#235) * add index in video.createdAt field * add pg_stat_extenstion extenstion for queries stats * docs: :sparkles: changelog and fix data-js (#237) --------- Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com> * fix: :ambulance: hotfix default value for channel weight no matter what --------- Co-authored-by: Zeeshan Akram <37098720+zeeshanakram3@users.noreply.github.com> --- src/utils/VideoRelevanceManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/VideoRelevanceManager.ts b/src/utils/VideoRelevanceManager.ts index deb09d40c..0287be677 100644 --- a/src/utils/VideoRelevanceManager.ts +++ b/src/utils/VideoRelevanceManager.ts @@ -33,6 +33,7 @@ export class VideoRelevanceManager { [joystreamTimestampWeight, ytTimestampWeight] = [7, 3], defaultChannelWeight, ] = await config.get(ConfigVariable.RelevanceWeights, em) + const channelWeight = defaultChannelWeight ?? 1 await em.query(` WITH weighted_timestamp AS ( SELECT @@ -63,7 +64,7 @@ export class VideoRelevanceManager { (views_num * ${viewsWeight}) + (comments_count * ${commentsWeight}) + (reactions_count * ${reactionsWeight}) - ) * COALESCE(CW, ${defaultChannelWeight}), + ) * COALESCE(CW, ${channelWeight}), 2) FROM weighted_timestamp