Fix trends returning less results per page when filtered in REST API (#17996)
- Change filtering and pagination to occur in SQL instead of Redis - Change rank/score displayed on trends in admin UI to be locale-specific
This commit is contained in:
parent
6b72641641
commit
fd9a9b07c2
5 changed files with 20 additions and 31 deletions
|
@ -37,12 +37,12 @@ class Trends::Base
|
|||
Trends::Query.new(key_prefix, klass)
|
||||
end
|
||||
|
||||
def score(id)
|
||||
redis.zscore("#{key_prefix}:all", id) || 0
|
||||
def score(id, locale: nil)
|
||||
redis.zscore([key_prefix, 'all', locale].compact.join(':'), id) || 0
|
||||
end
|
||||
|
||||
def rank(id)
|
||||
redis.zrevrank("#{key_prefix}:allowed", id)
|
||||
def rank(id, locale: nil)
|
||||
redis.zrevrank([key_prefix, 'allowed', locale].compact.join(':'), id)
|
||||
end
|
||||
|
||||
def currently_trending_ids(allowed, limit)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue