restore /comments

pull/90/head
Aevann 2023-01-20 23:55:06 +02:00
parent 88d298801f
commit cc8a3211d9
1 changed files with 24 additions and 25 deletions

View File

@ -218,15 +218,14 @@ def comment_idlist(v=None, page=1, sort="new", t="day", gt=0, lt=0, site=None):
comments = comments.offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE + 1).all()
return [x[0] for x in comments]
if SITE != 'rdrama.net':
@app.get("/comments")
@auth_required
def all_comments(v:User):
@app.get("/comments")
@auth_required
def all_comments(v:User):
try: page = max(int(request.values.get("page", 1)), 1)
except: page = 1
sort=request.values.get("sort", "new")
t=request.values.get("t", DEFAULT_TIME_FILTER)
t=request.values.get("t", "hour")
try: gt=int(request.values.get("after", 0))
except: gt=0