mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-06 22:15:48 +01:00
use the first set for sorting
This commit is contained in:
@@ -90,7 +90,10 @@ module.exports = function (Categories) {
|
||||
var stop = data.stop === -1 ? data.stop : start + normalTidsToGet - 1;
|
||||
|
||||
if (Array.isArray(set)) {
|
||||
db[direction === 'highest-to-lowest' ? 'getSortedSetRevIntersect' : 'getSortedSetIntersect']({ sets: set, start: start, stop: stop }, next);
|
||||
var weights = set.map(function (s, index) {
|
||||
return index ? 0 : 1;
|
||||
});
|
||||
db[direction === 'highest-to-lowest' ? 'getSortedSetRevIntersect' : 'getSortedSetIntersect']({ sets: set, start: start, stop: stop, weights: weights }, next);
|
||||
} else {
|
||||
db[direction === 'highest-to-lowest' ? 'getSortedSetRevRange' : 'getSortedSetRange'](set, start, stop, next);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user