You've already forked KemoFureApi
added post order modes
This commit is contained in:
@@ -42,10 +42,17 @@ class Archive_GetPosts(Resource):
|
||||
if ratings == []:
|
||||
ratings = ["SFW", "NSFW"]
|
||||
|
||||
if "random" in request.args:
|
||||
order = "RAND"
|
||||
elif "ascending" in request.args:
|
||||
order = "ASC"
|
||||
else:
|
||||
order = "DESC"
|
||||
|
||||
real_page = page-1
|
||||
offset = real_page * count
|
||||
|
||||
result = db.get_posts(count, artist, actions_taken=actions, last_id= -1, offset= offset, include_ratings= ratings)
|
||||
result = db.get_posts(count, artist, actions_taken=actions, last_id= -1, offset= offset, include_ratings= ratings, order=order)
|
||||
|
||||
if result is None:
|
||||
response = app.response_class(status=400)
|
||||
|
||||
Reference in New Issue
Block a user