Commit 71686f4a authored by Fence's avatar Fence 🌈

silly tired me

parent a836433d
......@@ -19,9 +19,7 @@ class MusicController(FlaskController):
if "song" in payload:
song = Song.objects.get(id=payload["song"])
if song is not None:
print(dir(song))
filename = "./uploads/" + str(song.id) + ".mp3"
print(filename)
if os.path.isfile(filename):
def generate():
with open(filename, "rb") as fogg:
......@@ -33,7 +31,7 @@ class MusicController(FlaskController):
else:
return jsonify({"code": 400, "message": "bad_request"}), 400
#@auth_required
@auth_required
@route("/song/<id>")
def song(self, id, payload=None):
song = Song.objects.get(id=id)
......@@ -81,7 +79,7 @@ class MusicController(FlaskController):
except KeyError:
return jsonify({"code": 400, "message": "bad_request"}), 400
# @auth_required
@auth_required
@route("/song/<id>/upload", methods=["POST"])
def song_file(self, id, payload=None):
if 'file' in request.files:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment