fdfd
This commit is contained in:
parent
c6b78ccd72
commit
936f9338b1
1 changed files with 8 additions and 1 deletions
|
@ -137,7 +137,14 @@ def songs(id):
|
|||
try: id = int(id)
|
||||
except: return '', 400
|
||||
user = g.db.query(User).filter_by(id=id).first()
|
||||
return send_from_directory('/songs/', f'{user.song}.mp3')
|
||||
return redirect(f"/song/{user.song}.mp3")
|
||||
|
||||
@app.get("/song/<song>")
|
||||
def songs(song):
|
||||
resp = make_response(send_from_directory('/songs/', song))
|
||||
resp.headers.remove("Cache-Control")
|
||||
resp.headers.add("Cache-Control", "public, max-age=2628000")
|
||||
return resp
|
||||
|
||||
@app.post("/subscribe/<post_id>")
|
||||
@auth_required
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue