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

This commit is contained in:
Baris Usakli
2018-11-26 14:47:02 -05:00
parent f3e08f0850
commit 1bb6067e19

View File

@@ -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);
}