remotes/1693045480750635534/spooky-22
Aevann1 2021-07-30 11:47:12 +02:00
parent 5f97e8b3a9
commit e494965f94
1 changed files with 6 additions and 0 deletions

View File

@ -180,6 +180,9 @@ def frontlist(v=None, sort="hot", page=1,t="all", ids_only=True, filter_words=''
@app.get("/api/v1/listing")
@auth_desired
def front_all(v):
start = time.time()
if v and v.is_banned and not v.unban_utc: return render_template("seized.html")
try: page = int(request.args.get("page") or 1)
@ -214,6 +217,9 @@ def front_all(v):
# check if ids exist
posts = get_posts(ids, v=v)
print(type(time.time()))
print(time.time() - start)
if request.path == "/": return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page)
else: return jsonify({"data": [x.json for x in posts], "next_exists": next_exists})