fsfd
This commit is contained in:
parent
2777f0dce3
commit
209938d284
54 changed files with 375 additions and 320 deletions
|
@ -160,7 +160,7 @@ def front_all(v, sub=None):
|
|||
sort=request.values.get("sort", defaultsorting)
|
||||
t=request.values.get('t', defaulttime)
|
||||
ccmode=request.values.get('ccmode', "false")
|
||||
subs=request.values.get('subs', "false")
|
||||
subs=session.get('subs', False)
|
||||
|
||||
try: gt=int(request.values.get("utc_greater_than", 0))
|
||||
except: gt=0
|
||||
|
@ -259,17 +259,17 @@ def front_all(v, sub=None):
|
|||
g.db.commit()
|
||||
|
||||
if request.headers.get("Authorization"): return {"data": [x.json for x in posts], "next_exists": next_exists}
|
||||
return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page, ccmode=ccmode, subs=subs, sub=sub, home=True)
|
||||
return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page, ccmode=ccmode, sub=sub, subs=subs, home=True)
|
||||
|
||||
|
||||
|
||||
@cache.memoize(timeout=86400)
|
||||
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false", subs="false", filter_words='', gt=0, lt=0, sub=None, site=None):
|
||||
def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false", subs=False, filter_words='', gt=0, lt=0, sub=None, site=None):
|
||||
|
||||
posts = g.db.query(Submission)
|
||||
|
||||
if sub: posts = posts.filter_by(sub=sub.name)
|
||||
elif subs == "true":
|
||||
elif subs:
|
||||
if v and v.all_blocks: posts = posts.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
|
||||
else:
|
||||
if SITE_NAME == 'Drama': posts = posts.filter(Submission.sub == None)
|
||||
|
@ -351,7 +351,7 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
|||
if (sort == "hot" or (v and v.id == Q_ID)) and page == 1 and ccmode == "false" and not gt and not lt:
|
||||
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
|
||||
if sub: pins = pins.filter_by(sub=sub.name)
|
||||
elif subs == "true":
|
||||
elif subs:
|
||||
if v and v.all_blocks: pins = pins.filter(or_(Submission.sub == None, Submission.sub.notin_(v.all_blocks)))
|
||||
else:
|
||||
if SITE_NAME == 'Drama': pins = pins.filter(Submission.sub == None)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue