Add an easier way to access order/delay
This commit is contained in:
parent
af5b58a8ad
commit
4eb9ff1188
9
main.py
9
main.py
@ -158,6 +158,15 @@ async def root():
|
|||||||
return RedirectResponse(url="/{hash}".format(hash=random_hash))
|
return RedirectResponse(url="/{hash}".format(hash=random_hash))
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/{order}/{delay}")
|
||||||
|
async def order_delay(order: str, delay: int):
|
||||||
|
"""Redirect to random file with order and delay"""
|
||||||
|
random_hash = _get_random_hash()
|
||||||
|
return RedirectResponse(
|
||||||
|
url="/{order}/{delay}/{hash}".format(order=order, delay=delay, hash=random_hash)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _get_navigation_data(file_hash: str):
|
def _get_navigation_data(file_hash: str):
|
||||||
"""Get navigation data for a file hash"""
|
"""Get navigation data for a file hash"""
|
||||||
keys = list(file_mapping.keys())
|
keys = list(file_mapping.keys())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user