fix: controversial posts/bests posts not showing anything

fix upgrade script so posts with negative votes are stored, a post can have 10 upvotes and 2 downvotes
fix missing negative votes checks
remove unnecessary pids flters since the cids are only already filtered by topics:read
This commit is contained in:
Barış Soner Uşaklı
2022-02-04 21:52:44 -05:00
parent e6185883ba
commit 079c487dcb
5 changed files with 16 additions and 24 deletions

View File

@@ -158,7 +158,7 @@ module.exports = function (Posts) {
bulkAdd.push([`uid:${toUid}:posts`, post.timestamp, post.pid]);
bulkAdd.push([`cid:${post.cid}:uid:${toUid}:pids`, post.timestamp, post.pid]);
if (post.votes > 0) {
if (post.votes > 0 || post.votes < 0) {
bulkAdd.push([`cid:${post.cid}:uid:${toUid}:pids:votes`, post.votes, post.pid]);
}
postsByUser[post.uid] = postsByUser[post.uid] || [];