fsd
This commit is contained in:
parent
314d0dd781
commit
9895ca2110
2 changed files with 5 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -10,4 +10,4 @@ venv/
|
||||||
.sass-cache/
|
.sass-cache/
|
||||||
flask_session/
|
flask_session/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
site_settings
|
site_settings.json
|
|
@ -355,9 +355,12 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
if not (v and v.shadowbanned):
|
if not (v and v.shadowbanned):
|
||||||
posts = posts.join(User, User.id == Submission.author_id).filter(User.shadowbanned == None)
|
posts = posts.join(User, User.id == Submission.author_id).filter(User.shadowbanned == None)
|
||||||
|
|
||||||
|
if request.host == 'rdrama.net': num = 5
|
||||||
|
else: num = 1
|
||||||
|
|
||||||
if sort == "hot":
|
if sort == "hot":
|
||||||
ti = int(time.time()) + 3600
|
ti = int(time.time()) + 3600
|
||||||
posts = posts.order_by(-1000000*(Submission.realupvotes + 1 + Submission.comment_count/5 + (func.length(Submission.body_html)-func.length(func.replace(Submission.body_html,'</a>','')))/4)/(func.power(((ti - Submission.created_utc)/1000), 1.23)), Submission.created_utc.desc())
|
posts = posts.order_by(-1000000*(Submission.realupvotes + 1 + Submission.comment_count/num + (func.length(Submission.body_html)-func.length(func.replace(Submission.body_html,'</a>','')))/4)/(func.power(((ti - Submission.created_utc)/1000), 1.23)), Submission.created_utc.desc())
|
||||||
elif sort == "bump":
|
elif sort == "bump":
|
||||||
posts = posts.filter(Submission.comment_count > 1).order_by(Submission.bump_utc.desc(), Submission.created_utc.desc())
|
posts = posts.filter(Submission.comment_count > 1).order_by(Submission.bump_utc.desc(), Submission.created_utc.desc())
|
||||||
elif sort == "new":
|
elif sort == "new":
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue