fd
This commit is contained in:
parent
37dbd32ca6
commit
e17767edda
1 changed files with 3 additions and 4 deletions
|
@ -162,9 +162,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
if lt:
|
||||
posts = posts.filter(Submission.created_utc < lt)
|
||||
|
||||
# if not (v and v.shadowbanned):
|
||||
# posts = posts.join(Submission.author).filter(User.shadowbanned == False)
|
||||
|
||||
if sort == "hot":
|
||||
posts = sorted(posts.all(), key=lambda x: x.hotscore, reverse=True)
|
||||
elif sort == "new":
|
||||
|
@ -186,7 +183,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
abort(400)
|
||||
|
||||
firstrange = 25 * (page - 1)
|
||||
secondrange = firstrange+200
|
||||
secondrange = firstrange+100
|
||||
posts = posts[firstrange:secondrange]
|
||||
|
||||
if random.random() < 0.004:
|
||||
|
@ -206,6 +203,8 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
|||
post.views = post.views + random.randint(7,10)
|
||||
g.db.add(post)
|
||||
|
||||
posts = [p for p in posts if not p.author.shadowbanned]
|
||||
|
||||
next_exists = (len(posts) > 25)
|
||||
|
||||
posts = posts[:25]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue