fd
This commit is contained in:
parent
ae6e22b2b5
commit
c24f02f915
1 changed files with 4 additions and 4 deletions
|
@ -157,9 +157,9 @@ 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 not (v and v.shadowbanned):
|
#if not (v and v.shadowbanned):
|
||||||
posts=posts.join(Submission.author)
|
#posts=posts.join(Submission.author)
|
||||||
posts=posts.filter(User.shadowbanned == False)
|
posts=posts.filter(Submission.author.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)
|
||||||
|
@ -182,7 +182,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, filter_words='
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
firstrange = 50 * (page - 1)
|
firstrange = 50 * (page - 1)
|
||||||
secondrange = firstrange+51
|
secondrange = firstrange+200
|
||||||
posts = posts[firstrange:secondrange]
|
posts = posts[firstrange:secondrange]
|
||||||
|
|
||||||
if random.random() < 0.004:
|
if random.random() < 0.004:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue