From 1bb6067e1900c3cfecad65b07c4bfb704172660e Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Mon, 26 Nov 2018 14:47:02 -0500 Subject: [PATCH] suggested topics fix, if search doesn't return enough topics --- src/topics/suggested.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/topics/suggested.js b/src/topics/suggested.js index 3e8cd0e0c0..e6c32a4327 100644 --- a/src/topics/suggested.js +++ b/src/topics/suggested.js @@ -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); }