forked from rDrama/rDrama
master
parent
8562bd8987
commit
4091702062
|
@ -162,6 +162,11 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
||||||
if lt:
|
if lt:
|
||||||
posts = posts.filter(Submission.created_utc < lt)
|
posts = posts.filter(Submission.created_utc < lt)
|
||||||
|
|
||||||
|
if v and v.shadowbanned:
|
||||||
|
posts = posts.join(Submission.author).filter(or_(User.shadowbanned == False, User.id == v.id))
|
||||||
|
else:
|
||||||
|
posts = posts.join(Submission.author).filter(User.shadowbanned == False)
|
||||||
|
|
||||||
if sort == "hot":
|
if sort == "hot":
|
||||||
posts = sorted(posts.all(), key=lambda x: x.hotscore, reverse=True)
|
posts = sorted(posts.all(), key=lambda x: x.hotscore, reverse=True)
|
||||||
elif sort == "new":
|
elif sort == "new":
|
||||||
|
@ -203,8 +208,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
||||||
post.views = post.views + random.randint(7,10)
|
post.views = post.views + random.randint(7,10)
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
|
|
||||||
posts = [p for p in posts if not p.author.shadowbanned]
|
|
||||||
|
|
||||||
next_exists = (len(posts) > 25)
|
next_exists = (len(posts) > 25)
|
||||||
|
|
||||||
posts = posts[:25]
|
posts = posts[:25]
|
||||||
|
|
Loading…
Reference in New Issue