reorder routes

pull/216/head
Aevann 2023-10-26 18:38:22 +03:00
parent 6730d7b2d8
commit 36c68bb869
1 changed files with 5 additions and 5 deletions

View File

@ -42,6 +42,11 @@ def reddit_post(subreddit, v, path):
return redirect(f'https://{reddit}/{post_id}')
@app.get("/marseys")
@app.get("/emojis")
def marseys_redirect():
return redirect("/emojis/Marsey")
@cache.cached(make_cache_key=lambda kind, nsfw:f"emoji_list_{kind}_{nsfw}")
def get_emoji_list(kind, nsfw):
li = g.db.query(Emoji, User).join(User, Emoji.author_id == User.id).filter(Emoji.submitter_id == None, Emoji.kind == kind)
@ -55,11 +60,6 @@ def get_emoji_list(kind, nsfw):
emojis.append(emoji)
return emojis
@app.get("/marseys")
@app.get("/emojis")
def marseys_redirect():
return redirect("/emojis/Marsey")
@app.get("/emojis/<kind>")
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)