suggested topics fix, if search doesn't return enough topics

v1.18.x
Baris Usakli 6 years ago
parent f3e08f0850
commit 1bb6067e19

@ -93,7 +93,8 @@ module.exports = function (Topics) {
db.getSortedSetRevRange('cid:' + cid + ':tids:lastposttime', 0, 9, next);
},
function (tids, next) {
next(null, tids.map(Number));
tids = tids.map(Number).filter(_tid => _tid !== tid);
next(null, _.shuffle(tids));
},
], callback);
}

Loading…
Cancel
Save