Commit 2d651a23 authored by Fence's avatar Fence 🌈

try to fix the api

parent 038124eb
......@@ -21,7 +21,7 @@ class MusicController(FlaskController):
if "song" in payload:
song = Song.objects.get(id=payload["song"])
if song is not None:
filename = self._upload_dir + str(song.id) + ".mp3"
filename = self._upload_dir + "/" + str(song.id) + ".mp3"
if os.path.isfile(filename):
def generate():
with open(filename, "rb") as fogg:
......@@ -47,7 +47,7 @@ class MusicController(FlaskController):
def song_has_file(self, id, payload=None):
song = Song.objects.get(id=id)
if song is not None:
filename = self._upload_dir + str(song.id) + ".mp3"
filename = self._upload_dir + "/" + str(song.id) + ".mp3"
if os.path.isfile(filename):
return jsonify({"code": 200, "message": "ok", "data": True}), 200
else:
......
flask
jwt
PyJWT==1.7.1
flask_mongoengine
git+https://github.com/AlexFence/FlaskController.git
mutagen
\ No newline at end of file
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